ROS学习(六)launch文件学习(一)

@TOC

参考文章: http://wiki.ros.org/roslaunch/XML.

< launch > 标签

launch文件中的根元素采用标签定义

< node > 标签

Example


pkg=“mypackage” :包名

type=“nodetype” :文件名,运行的文件名称

name=“nodename” :节点名称

args=“arg1 arg2 arg3”(optional):Pass arguments to node.

machine=“machine-name”(optional, see ):Launch node on designated machine.

respawn=“true”(optional, default: False):Restart the node automatically if it quits.

respawn_delay=“30” (optional, default 0) :New in ROS indigo
If respawn is true, wait respawn_delay seconds after the node failure is detected before attempting restart.

required=“true”(optional)
ROS 0.10: If node dies, kill entire roslaunch.

ns=“foo”(optional)
Start the node in the ‘foo’ namespace.

clear_params=“true|false”(optional)
Delete all parameters in the node’s private namespace before launch.

output=“log|screen”(optional)
If ‘screen’, stdout/stderr from the node will be sent to the screen. If ‘log’, the stdout/stderr output will be sent to a log file in $ROS_HOME/log, and stderr will continue to be sent to screen. The default is ‘log’.

< param > < rosparam > 标签

设置ROS系统运行中的参数,存储在参数服务器中;


• name:参数名
• value:参数值
加载参数文件中的多个参数:


< arg > 标签

launch文件内部的局部变量,仅限于launch文件使用


• name:参数名
• value:参数值
调用:



< remap > 标签

重映射ROS计算图资源的命名。


• from:原命名
• to:映射之后的命名

< include > 标签

包含其他launch文件,类似C语言中的头文件包含。


• file:包含的其他launch文件路径

编写一个简单的launch文件并运行

mkdir launch
cd launch & sudo nano simple.launch


    
    
     

cd ~/ws
catkin_make
source devel/setup.bash
roslaunch learning_topic simple.launch

运行效果

ROS学习(六)launch文件学习(一)_第1张图片

你可能感兴趣的:(ROS学习)