1. roslaunch命令行语法
- 启动roslaunch,会自动打开roscore
roslaunch pkg_name xxx.launch
roslaunch xx/xx/xxx.launch
- 传参
roslaunch pkg_name xxx.launch arg:=value
2. launch文件语法
<launch>
和</launch>
是launch的根标签,其中包含了所有的内容<arg>
标签用于传递命令行参数到 launch 文件中,也可以定义默认值:
name
: 参数的名称default
: 如果没有提供值时使用的默认值value
:强制指定的值,不可以通过命令行传参替代
<arg name="xxx" value="$(find xxx)/xxxxx />
<node>
标签用于定义要启动的 ROS 节点。常见属性包括:
pkg
: 节点所在的 ROS 包名称name
: 节点的名称type
: 节点的可执行文件名称output
: 指定日志输出的方式 (screen 或 log)launch-prefix
:重新开一个窗口执行
- 加载其他launch文件
<include file="$(find package_name)/launch/other_launch_file.launch" />