標(biāo)題:
機(jī)器人自動(dòng)導(dǎo)航建圖源碼 xbot_slam-master
[打印本頁(yè)]
作者:
aaa923124003
時(shí)間:
2018-11-30 10:56
標(biāo)題:
機(jī)器人自動(dòng)導(dǎo)航建圖源碼 xbot_slam-master
機(jī)器人自動(dòng)導(dǎo)航建圖源碼
0.png
(42.7 KB, 下載次數(shù): 74)
下載附件
2018-11-30 15:22 上傳
單片機(jī)源程序如下:
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
int main(int argc, char **argv)
{
ros::init(argc, argv, "subgoal");
ros::NodeHandle n;
ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);
ros::Rate loop_rate(10);
int count = 0;
while (ros::ok())
{
/**
* This is a message object. You stuff it with data, and then publish it.
*/
std_msgs::String msg;
std::stringstream ss;
ss << "hello world " << count;
msg.data = ss.str();
ROS_INFO("%s", msg.data.c_str());
/**
* The publish() function is how you send messages. The parameter
* is the message object. The type of this object must agree with the type
* given as a template parameter to the advertise<>() call, as was done
* in the constructor above.
*/
chatter_pub.publish(msg);
ros::spinOnce();
loop_rate.sleep();
++count;
}
return 0;
}
復(fù)制代碼
所有資料51hei提供下載:
xbot_slam-master.zip
(390.82 KB, 下載次數(shù): 24)
2018-11-30 10:56 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
作者:
aaa923124003
時(shí)間:
2018-11-30 10:59
這個(gè)包含了仿真程序,可以直接在linux下使用
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1