ROS学习笔记——roslaunch

roslaunch用于方便我们一下子启动多个节点

1.常用语法(这里只列举我个人常用的一部分)
更全的roslaunch语法看官网

roslaunch <package-name> <launch-filename> [args]
roslaunch <launch-file-paths...> [args]

[args] 是非必须部分,用来传递参数

2.launch文件结构

<launch>  任何launch文件必须要有的部分,表明这是个launch文件

<node>    表明你要运行的节点

<param>   Set a parameter on the Parameter Server

<remap>   Declare a name remapping.

<machine> Declare a machine to use for launching.

<rosparam>Set ROS parameters for the launch using a rosparam file.

<include> Include other roslaunch files.

<env>     Specify an environment variable for launched nodes.

<test>    Launch a test node (see rostest).

<arg>     Declare an argument.

<group>   Group enclosed elements sharing a namespace or remap.

2.1 < node >

<node name="listener1" pkg="rospy_tutorials" type="listener.py" args="--test" respawn="true" />

用包rospy_tutorials里的可执行文件listener.py来运行节点,并给他取名叫为listener1,用到的命令行是–test,且这个节点会自动复活

2.2 < param >
把parameter放进参数服务器里,相当于设置静态变量供各个节点使用

< param name="publish_frequency" type="double" value="10.0" /> 
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值