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

What is the correct way to set args in rosparam?

asked 2012-07-17 18:38:34 -0600

weiin gravatar image

I'm trying to launch the Multimaster node requiring parameter lists. Inside the list, I need to use an arg that would be used in other nodes in the same launch file. This is what I'd like in effect (it does not work):

  <arg name="robotname" default="robot1" />

  <node pkg="multimaster" type="" name="master_sync" output="screen" respawn="true"> 
    <param name="foreign_master" value="http://localhost:11311" />      
      local_pubs: [$(arg robotname)/status, /some_other_topics]

What should be the correct way to get $(arg robotname) into the parameter list?

edit retag flag offensive close merge delete


Pull request with a preliminary implementation of this feature here:

jbohren gravatar image jbohren  ( 2013-03-28 16:02:15 -0600 )edit

Have you found a workaround for this issue?

autonomy gravatar image autonomy  ( 2013-11-07 05:09:35 -0600 )edit

Nope, I've been busy with other things. My original implementation was pushed back to me by the ros-core team, but the followup ticket is still open: ( )

jbohren gravatar image jbohren  ( 2013-11-07 05:41:36 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-14 13:02:47 -0600

lucasw gravatar image

updated 2015-05-14 13:03:26 -0600

This has since been implemented, set subst_value="true":

<rosparam param="whitelist" subst_value="true">$(arg whitelist)</rosparam>

edit flag offensive delete link more

answered 2012-07-17 22:52:35 -0600

Lorenz gravatar image

updated 2012-07-17 22:53:22 -0600

As far as I know, you cannot use substitution args inside <rosparam> because roslaunch just parses the complete text using a yaml parser, i.e. no substitutions are done. On the other hand, you cannot create lists using <param .../> so I assume what you are trying is not possible at the moment. I think that this would be a nice feature to have. Maybe you should open a feature request at

edit flag offensive delete link more

Question Tools



Asked: 2012-07-17 18:38:34 -0600

Seen: 5,680 times

Last updated: May 14 '15