Ask Your Question
4

Roslaunch machine tag on include

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

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
2

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

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

Comments

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 imagecellard0or ( 2017-04-12 09:34:36 -0600 )edit

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

schwarmcyc gravatar imageschwarmcyc ( 2017-06-16 03:36:31 -0600 )edit
4

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

Girmi gravatar image

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

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!

edit flag offensive delete link more

Comments

1

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 imagecellard0or ( 2017-04-12 06:44:19 -0600 )edit
1

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

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

and here the launchfile.launch:

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

Arguments are discribed here

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

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

Seen: 2,443 times

Last updated: Oct 05 '18