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

When to use param and rosparam on launch file?

asked 2012-07-04 03:06:03 -0500

sam gravatar image

For param example:

   <!-- send table urdf to param server -->
   <param name="table_description" command="$(find      xacro)/ $(find gazebo_worlds)/objects/table.urdf.xacro" />

   <!-- push table_description to factory and spawn robot in      gazebo -->
   <node name="spawn_table" pkg="gazebo" type="spawn_model"      args="-urdf -param table_description -z 0.01 -model table_model"      respawn="false" output="screen" />

For rosparam example:

   <node name="fake_localizaton" type="fake_localization"      pkg="fake_localization">
       odom_frame_id: odom_combined
       base_frame_id: base_footprint

What's their difference?

What's the case of using them?

Thank you~

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-04 03:56:32 -0500

mjcarroll gravatar image

I believe that the main difference is that <param> may be used to set a single command on the ROS parameter server, while <rosparam> can be used to evaluate groups of parameters.

So, in the cases above, <param> is setting a single parameter, and that parameter is an entire URDF file. The <rosparam> tag is reading in the rosparam yaml format from within the launch file.

The value set by the <param> tag may only be a string, int, bool, or double, which may be set through the xml attribute value, or by reading in from a text file, bin file, or the output of a command line command.

The value set by the <rosparam> tag is most commonly a batch of related parameters, read in from a YAML file (or from the output of rosparam dump). You can think of it as a programmatic way to access the functionality of rosparam from a launch file. A good example of this in practice is the move_base related nodes, where there are many, many parameters to be set, it's less cumbersome to just use the YAML format.

For more information on all of these topics, I would consult the following:

edit flag offensive delete link more



This information has been added here: (feel free to edit)

jbohren gravatar image jbohren  ( 2013-07-02 18:06:39 -0500 )edit

Question Tools



Asked: 2012-07-04 03:06:03 -0500

Seen: 39,744 times

Last updated: Jul 04 '12