ros2 launch的yml和xml写法

yml写法:

yaml 复制代码
launch:
    - node:
        pkg: "pub_app"
        exec: "publisher"
        name: "pub_app"
        namespace: "desertrescue"
    - node:
        pkg: "sub_app"
        exec: "minimal_subscriber"
        name: "minimal_subscriber"
        namespace: "desertrescue"

直接ros2 launch /pathto/yml

xml写法:

xml 复制代码
<launch>
  <node pkg="pub_app" exec="publisher" name="pub_app" output="screen">
  </node>
</launch>

还可以直接指定参数文件:

xml 复制代码
<launch>
  <node pkg="my_package" exec="my_node" name="my_node_name" output="screen">
    <param from="path/to/params.yaml"/>
  </node>
</launch>

或:

xml 复制代码
<launch>
  <node pkg="my_package" exec="my_node" name="my_node" output="screen">
    <param from="$(find my_package)/config/params.yaml"/>
  </node>
</launch>

但xml写法需要将xml文件通过cmake或人工拷贝到ros2 install对应的节点路径的share目录下,否则会报错

拷贝之后直接ros2 launch pkg xxx.xml即可,tab会弹出可选xml

相关推荐
深圳慧闻智造技术有限公司3 小时前
从宇树G1做手术登Nature,看机器人精密零件加工的四大难点与核心能力
机器人·精密零件加工·机器人零件加工·精密机械加工
ZPC82103 小时前
model bingxing
网络·人工智能·网络协议·机器人
code_pgf4 小时前
具身智能的核心组成部分及其作用
人工智能·机器人
QYR-分析4 小时前
柔性智造赋能升级!机器人视觉检测系统行业高速扩容,国产替代迎来新机遇
人工智能·机器人
SoaringPigeon1 天前
NVIDIA博客-预训练去想象,微调去行动:世界-动作模型 (WAM) 的崛起
人工智能·深度学习·机器人·自动驾驶
Maiko Star1 天前
Python项目实战——网络机器人(爬虫)
爬虫·python·机器人
SoaringPigeon1 天前
机器人学习中的世界模型:一份全景式技术综述
人工智能·机器人·自动驾驶
SoaringPigeon1 天前
世界动作模型(WAM)综述:从 VLA 到具身智能的下一前沿
人工智能·机器人·自动驾驶
kyle~1 天前
Haply Inverse3 力反馈设备
人工智能·机器人·智能硬件·力反馈
sanzk1 天前
虚拟机ubuntu22.04 ros2humble安装microros_agent
机器人