0
$\begingroup$

Rosanswers logo

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>

Originally posted by thebyohazard on ROS Answers with karma: 3562 on 2015-07-08

Post score: 6

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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>

Originally posted by Tiki with karma: 76 on 2018-03-22

This answer was ACCEPTED on the original site

Post score: 6

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by Vincent Rabaud with karma: 1111 on 2015-09-22

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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