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

Revision history [back]

click to hide/show revision 1
initial version

You can use <include> tag to add 2nd launch file in the first one.

That way you should be able to get folder path, and you can add a conditional argument (bool), if that is set to true it will launch the second launch. Your first launch file should be something like this.

<launch>
  <arg name="folder_path"    deafult="path"/>
  <arg name="launch_second" default="false"/>

  <include if="$(arg launch_second)" file="$(find package_name)/launch/second-launch.launch">
    <arg name="folder_path"  value="$(arg folder_path)"/>
  </include>
</launch>

and when launching the first launch file you can set launch_second to true like:

roslaunch package_name first_launch.launch launch_second:=true

You can use <include> tag to add 2nd launch file in the first one.

That way you should be able to get folder path, and you can add a conditional argument (bool), if that is set to true it will launch the second launch. Your first launch file should be something like this.

<launch>
  <arg name="folder_path"    deafult="path"/>
  <arg name="launch_second" default="false"/>

  <include if="$(arg launch_second)" file="$(find package_name)/launch/second-launch.launch">
    <arg name="folder_path" name="folderpath"  value="$(arg folder_path)"/>
  </include>
</launch>

and when launching the first launch file you can set launch_second to true like:

roslaunch package_name first_launch.launch launch_second:=true