0
$\begingroup$

Rosanswers logo

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?


Originally posted by weiin on ROS Answers with karma: 2268 on 2012-07-17

Post score: 4


Original comments

Comment by jbohren on 2013-03-28:
Pull request with a preliminary implementation of this feature here: https://github.com/ros/ros_comm/pull/203

Comment by autonomy on 2013-11-07:
Have you found a workaround for this issue?

Comment by jbohren on 2013-11-07:
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 )

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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

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

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


Originally posted by lucasw with karma: 8729 on 2015-05-14

This answer was ACCEPTED on the original site

Post score: 5

$\endgroup$
0
$\begingroup$

Rosanswers logo

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/.


Originally posted by Lorenz with karma: 22731 on 2012-07-17

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.