在工作空间中某文件夹中创建launch文件夹,在此文件夹中创建.launch文件,打开写程序,要保存。
ctrl+~启动当前工作空间的终端,输入:
source ./devel/setup.bash
roslaunch 某文件夹 .launch文件
成功界面:
![](https://img-blog.csdnimg.cn/img_convert/172feeb4f6cbff1c76f9022950fd41f5.png)
launch文件设置node格式:
<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>
其中:node代表节点;pkg代表包名(文件名);type代表(.c .py .launch)文件;name代表给这个文件取个名;当输出文字日志时,加上output="screen"。