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

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="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 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: ( https://www.bountysource.com/issues/742041-add-substitution-args-parsing-to-roslaunch-yaml )

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

2 Answers

Sort by ยป oldest newest most voted
5

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>

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

edit flag offensive delete link more
3

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

edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 5,853 times

Last updated: May 14 '15