目录
如果只想看launch文件的编写查看第三点即可
首先创建一个工作空间以及一个src子目录,然后再进入工作空间调用catkin_make命令编译
mkdir -p demo01_ws/src
cd demo01_ws/
catkin_make
(具体环境搭建见:ROS中结合C++语言实现HelloWorld_阿巴according的博客-CSDN博客)
再到工具包中hello_vscode中创建launch目录
再到launch目录下创建start_turtle.launch文件

- <launch>
-
-
- <node pkg="turtlesim" type="turtlesim_node" name="turtle_GUI" />
-
- <node pkg="turtlesim" type="turtle_teleop_key" name="turtle_key" />
-
- <node pkg="hello_vscode" type="hello_vscode_c" name="hello" output="screen" />
- launch>
注意:只要写了
就相当于在文件里面写入了roscore
node包含的某个节点,pkg是功能包名,type是节点,name是为节点命名,output="screen"是将日志内容内容输入到、屏幕上。
首先到工作的环境下
source ./devel/setup.bash
roslaunch hello_vscode start_turtle.launch
