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

roslaunch xml: how to pass a list of strings as parameters?

asked 2015-07-08 14:58:50 -0500

thebyohazard gravatar image

updated 2021-11-13 13:53:21 -0500

lucasw gravatar image

Is there any way to pass a list of strings as an argument in a launch file? Something like

<launch>
  <arg name="source_list" default="[a_topic,a_second_topic]"/>
  <node>
     <param name="source_list" value="$(arg source_list)"/>
  </node>
</launch>
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2018-03-22 10:37:47 -0500

Tiki gravatar image

updated 2019-03-14 16:37:08 -0500

lucasw gravatar image

This:

<launch>
  <arg name="source_list" default="[a_topic,a_second_topic]"/>

    <node ...>

         <rosparam param="source_list" subst_value="True">$(arg source_list)</rosparam> 

    </node>
</launch>
edit flag offensive delete link more
2

answered 2015-09-22 05:01:28 -0500

Vincent Rabaud gravatar image

You can use rosparam. There is an example given here: http://wiki.ros.org/roslaunch/XML/ros...

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2015-07-08 14:58:50 -0500

Seen: 13,314 times

Last updated: Nov 13 '21