1.将某一个节点的话题名称改为另一个话题名称
<launch deprecated="别狗把用了">
<node pkg="turtlesim" type="turtlesim_node" name="myTurtle" output="screen" >
<remap from="/turtle1/cmd_vel" to="/cmd_vel"/>
</node>
<node pkg="turtlesim" type="turtle_teleop_key" name="myTurtleContro" output="screen" />
</launch>
注意第二行node标签最后面没有斜
2.arg标签用法
<launch>
<!-- arg相当于设置一个变量,创建其他的参数的时候调用这个变量,就可以同时改变多个参数值 -->
<arg name="length" default="15"/>
<param name="zdw_length" value="$(arg length)"/>
<param name="hzr_length" value="$(arg length)"/>
<param name="dbk_length" value="$(arg length)"/>
</launch>
3.group用法
<launch>
<!-- group标签用于在不同的命名空间下启动同样的节点 -->
<group ns="ns1">
<node pkg="turtlesim" type="turtlesim_node" name="myTurtle" output="screen" />
<node pkg="turtlesim" type="turtle_teleop_key" name="myTurtleContro" output="screen" />
</group>
<group ns="ns2">
<node pkg="turtlesim" type="turtlesim_node" name="myTurtle" output="screen" />
<node pkg="turtlesim" type="turtle_teleop_key" name="myTurtleContro" output="screen" />
</group>
</launch>
3.param用法
<launch>
<!-- param标签用于在参数服务器创建参数,可以带命名空间 -->
<param name="god/zdw" value="20" type="int">
</param>
</launch>
4.rosparam remap 用法
<launch deprecated="别狗把用了">
<param name="zdw" value="23" type="int"/>
<!-- rosparam标签在node标签外面,用于在yaml文件向参数服务器写入参数 -->
<rosparam command="load" file="$(find pkg_launch)/launch/param.yaml" />
<node pkg="turtlesim" type="turtlesim_node" name="myTurtle" output="screen" >
<!-- remap标签用于node节点下,将该节点的话题名称进行重映射 -->
<remap from="/turtle1/cmd_vel" to="/cmd_vel"/>
<!-- 在节点的下一级用param,创建的参数带命名空间 -->
<param name="zdw" value="19" type="int"/>
<!-- 在yaml文件导入参数,并带命名空间 -->
<rosparam command="load" file="$(find pkg_launch)/launch/param.yaml" />
</node>
<node pkg="turtlesim" type="turtle_teleop_key" name="myTurtleContro" output="screen" />
<node pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" name="1Contro" output="screen" />
</launch>
5.include用法
<launch>
<!-- 在这个文件中启动其他launch文件的节点 -->
<include file="$(find pkg_launch)/launch/wugui.launch"/>
<remap from=""/>
</launch>