[Documentation] [TitleIndex] [WordIndex

<machine> tag

The <machine> tag declares a machine that you can run ROS nodes on. You do not need this tag if you are launching all the nodes locally. It is mainly used to declare SSH and ROS environment variable settings for remote machines, though you can also use it to declare information about the local machine.


The following attributes are available in ROS Electric and earlier:


Electric and earlier only: You can use the following XML tags inside of a <machine> tag:


The syntax of the <machine> tag is very different in ROS Electric, so please pay attention to the version indicator in the examples below.

Basic (ROS Electric and Previous Only)

The following example below shows configuring a node "footalker" to run another machine. In addition to overriding the ROS_ROOT and ROS_PACKAGE_PATH that the machine will use, the example also sets a LUCKY_NUMBER environment variable on the remote machine.

  <machine name="foo" address="foo-address" ros-root="/u/user/ros/ros/" ros-package-path="/u/user/ros/ros-pkg" user="someone">
    <env name="LUCKY_NUMBER" value="13" />

  <node machine="foo" name="footalker" pkg="test_ros" type="talker.py" />


Basic (ROS Fuerte and later) using env-loader

New in Fuerte

The following example below shows configuring a node "footalker" to run another machine. It uses the default env-loader file that comes with Fuerte.

  <machine name="foo" address="foo-address" env-loader="/opt/ros/fuerte/env.sh" user="someone"/>

  <node machine="foo" name="footalker" pkg="test_ros" type="talker.py" />


Here is an example env-loader script. Replace /opt/ros/fuerte/setup.sh with a different setup file if you wish to use a different environment configuration:


. /opt/ros/fuerte/setup.sh
exec "$@"

Alternatively, if you prefer to source from a rosws workspace:

#!/usr/bin/env bash

source /home/username/path/to/workspace/setup.bash
exec "$@"

2024-04-13 13:05