Ask Your Question
3

What is the correct way to set args in rosparam?

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

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="master_sync.py" name="master_sync" output="screen" respawn="true"> 
    <param name="foreign_master" value="http://localhost:11311" />      
    <rosparam>
      local_pubs: [$(arg robotname)/status, /some_other_topics]
    </rosparam>
  </node>

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

edit retag flag offensive close merge delete

Comments

Pull request with a preliminary implementation of this feature here: https://github.com/ros/ros_comm/pull/203

jbohren gravatar imagejbohren ( 2013-03-28 16:02:15 -0500 )edit

Have you found a workaround for this issue?

autonomy gravatar imageautonomy ( 2013-11-07 05:09:35 -0500 )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: ( https://www.bountysource.com/issues/742041-add-substitution-args-parsing-to-roslaunch-yaml )

jbohren gravatar imagejbohren ( 2013-11-07 05:41:36 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
4

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

lucasw gravatar image

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

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

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

http://wiki.ros.org/roslaunch/XML/ros...

edit flag offensive delete link more
3

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

Lorenz gravatar image

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

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 https://code.ros.org/trac/ros/.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 3,153 times

Last updated: May 14 '15