【工具学习】ROS的launch文件常用语法梳理

1. roslaunch命令行语法

  1. 启动roslaunch,会自动打开roscore
# 法一:
roslaunch pkg_name xxx.launch
# 法二:
roslaunch xx/xx/xxx.launch
  1. 传参
roslaunch pkg_name xxx.launch arg:=value

2. launch文件语法

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值