Roslaunch machine tag on include
I want to run a launch file on a remote machine. Is it possible to specify a machine for an <include> call in a roslaunch file?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
No this is not possible, this is nodes which are run remotely. On the opposite there is no computation linked to the XML files so there is no mean in launching one remotely. Therefore, all includes are local to your machine.
As @Girmi 's answer shows, there actually is a way to tell subsequent node launches which machine to use. Are there plans to put that implicit mechanism into an explicit tag for include, too? It would be extremely helpful since the current situation is sub-optimal for hierarchical launch structures.
Maybe Thomas is right. I tried @Girmi suggestion but still run local launch file on my local computer, not remote.
If anyone is still looking for an answer, I think currently the most elegant solution is:
<launch>
<include file="local_nodes.launch" />
<group>
<machine name="remote_machine" address="1.2.3.4" default="true" />
<include file="remote_nodes.launch" />
</group>
</launch>
Tested with ROS Kinectic on Ubuntu 16.04.
Edit: Apparently the machine tag doesn't apply to a specific group, but to any nodes/includes that come after it. So the order in which the tags are defined is important!
Thanks, this helped very much. Without this workaround I would have to adapt the structure of dozens of launch files. However, the <group> tag is not working here as nodes launched after the group still appear on remote. One has to define a new machine with the local address again afterwards. Ugly.
I've found a way and tested it in ROS-Indigo:
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.
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
Asked: 2013-10-03 11:01:52 -0600
Seen: 4,195 times
Last updated: Oct 05 '18