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

Roslaunch machine tag on include

asked 2013-10-03 11:01:52 -0500

sterlingm gravatar image

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?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-10-03 16:44:44 -0500

Thomas gravatar image

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.

edit flag offensive delete link more


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.

cellard0or gravatar image cellard0or  ( 2017-04-12 09:34:36 -0500 )edit

Maybe Thomas is right. I tried @Girmi suggestion but still run local launch file on my local computer, not remote.

schwarmcyc gravatar image schwarmcyc  ( 2017-06-16 03:36:31 -0500 )edit

answered 2017-01-17 02:58:06 -0500

Girmi gravatar image

updated 2018-10-05 08:17:31 -0500

If anyone is still looking for an answer, I think currently the most elegant solution is:

        <include file="local_nodes.launch" />

            <machine name="remote_machine" address="" default="true" />
            <include file="remote_nodes.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!

edit flag offensive delete link more



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.

cellard0or gravatar image cellard0or  ( 2017-04-12 06:44:19 -0500 )edit

The group tag doesn't work for me. Neither the code above (with default removed and user and env-loader added) nor the simply using the <node> tag without the machine name (but within group) work. I'm on 18.04/Melodic, but shouldn't make a difference ?

pring gravatar image pring  ( 2020-11-19 11:41:48 -0500 )edit

answered 2015-08-14 08:12:10 -0500

dannyknoll gravatar image

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" />

and here the launchfile.launch:

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

Arguments are discribed here

edit flag offensive delete link more

Question Tools



Asked: 2013-10-03 11:01:52 -0500

Seen: 4,134 times

Last updated: Oct 05 '18