ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use arg element in launch syntax. http://wiki.ros.org/roslaunch/XML/arg

An example (based on the example used in the link above) can look like:

my_file.launch:

<include file="included.launch">
  <!-- all vars that included.launch requires must be set -->
  <arg name="hoge" value="fuga" />
  <node pkg="rosbag" type="record" name="record" output="screen" args="-o $(arg hoge) -e /myTopic"/>
</include>

And you can run

roslaunch my_file.launch hoge:=my_value

Use arg element in launch syntax. http://wiki.ros.org/roslaunch/XML/arg

An example (based on the example used in the link above) can look like:

my_file.launch:rosbag_record.launch:

<include file="included.launch">
  <!-- all vars that included.launch requires must be set -->
<launch>
  <arg name="hoge" value="fuga" default="fuga" />
  <node pkg="rosbag" type="record" name="record" output="screen" args="-o $(arg hoge) -e /myTopic"/>
</launch>

top_level.launch:

<launch>
  <arg name="hoge" default="fuga" />
  <include file="included.launch">
    <arg name="hoge" value="$(arg hoge)" />
  </include>
</launch>

And you can run

roslaunch my_file.launch top_level.launch hoge:=my_value

Use arg element in launch syntax. http://wiki.ros.org/roslaunch/XML/arg

An example can look like:

rosbag_record.launch:

<launch>
  <arg name="hoge" default="fuga" />
  <node pkg="rosbag" type="record" name="record" output="screen" args="-o $(arg hoge) -e /myTopic"/>
</launch>

top_level.launch:

<launch>
  <arg name="hoge" default="fuga" />
  <include file="included.launch">
file="rosbag_record.launch">
    <arg name="hoge" value="$(arg hoge)" />
  </include>
</launch>

And you can run

roslaunch top_level.launch hoge:=my_value