Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could use eval (as of Kinetic) to create a recursive launchfile:


   <!-- start node -->
   <arg name="nr" default="1"/> 
   <group ns="$(eval 'turtle' + str(arg('nr')))">
      <node name="turtle" pkg="turtlesim" type="turtlesim_node"/>

   <!-- recursively start new node -->
   <include file="$(find your_package)/launch/this_launch_file.launch" if="$(eval arg('nr') - 1 > 0)">
       <arg name="nr" value="$(eval arg('nr') - 1)"/>


As of Lunar you could also use $(dirname) instead of $(find your_package)/launch.