<launch><!-- declare arg to be passed in --> <argname="hoge" /> <!-- read value of arg --> <paramname="param"value="$(arg hoge)"/></launch>
9.env标签
9.1 必选属性
10.全局示例
<launch><!-- local machine already has a definition by default. This tag overrides the default definition with specific ROS_ROOT and ROS_PACKAGE_PATH values --> <machine name="local_alt" address="localhost" default="true" ros-root="/u/user/ros/ros/" ros-package-path="/u/user/ros/ros-pkg" />
<!-- a basic listener node --> <nodename="listener-1"pkg="rospy_tutorials"type="listener" /><!-- pass args to the listener node --> <nodename="listener-2"pkg="rospy_tutorials"type="listener"args="-foo arg2" /><!-- a respawn-able listener node --> <nodename="listener-3"pkg="rospy_tutorials"type="listener"respawn="true" /><!-- start listener node in the 'wg1' namespace --> <nodens="wg1"name="listener-wg1"pkg="rospy_tutorials"type="listener"respawn="true" /><!-- start a group of nodes in the 'wg2' namespace --> <groupns="wg2"><!-- remap applies to all future statements in this scope. --> <remapfrom="chatter"to="hello"/> <nodepkg="rospy_tutorials"type="listener"name="listener"args="--test"respawn="true" /> <nodepkg="rospy_tutorials"type="talker"name="talker"><!-- set a private parameter for the node --> <paramname="talker_1_param"value="a value" /><!-- nodes can have their own remap args --> <remapfrom="chatter"to="hello-1"/><!-- you can set environment variables for a node --> <envname="ENV_EXAMPLE"value="some value" /> </node> </group></launch>