目录
1.创建工作空间
mkdir -p ~/test_ws/src
cd ~/test_ws/src
catkin_init_workspace
cd ~/test_ws
catkin_make

2.创建功能包
cd ~/tets_ws/src
catkin_create_pkg test-cpp roscpp std_msgs

3.在src中创建广播a.cpp
cd ~/test_ws/src/test-cpp/src
touch a.cpp
touch b.cpp
在a.cpp中写入
#include "ros/ros.h" //包含了使用ROS节点的必要文件
#include "std_msgs/String.h" //包含了使用的数据类型
#include <sstream>
int main(int argc, char **argv)
{
ros::init(argc,

最低0.47元/天 解锁文章
5348

被折叠的 条评论
为什么被折叠?



