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

I've found a way and tested it in ROS-Indigo:

  1. The Problem:

    the <node>-tag contains an attribute machine to set the machine on wich the node should run.

    If you want to include a launch-file with the <include>-tag and in this launchfile are some <node>-tags, include didn't provide a machine-Attribute for easy passing this information -> so normally only static launchfiles are possible.

  2. Solution

    Pass the machine with an argument through the <include>-tag!

Here my version:

<include file=/path/to/my/launchfile.launch>
      <arg name="machine" value="the_machine" />
 </include>

and here the launchfile.launch:

<launch>
 <arg name="machine" />     
 <node pkg="mypkg" name="mypkgname" machine="$(arg machine)">
</node>
</launch>

Arguments are discribed here