[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.

Attributes

The following attributes are available in ROS Electric and earlier:

Elements

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

Examples

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.

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

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

</launch>

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.

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

</launch>

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:

#!/bin/sh

. /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-11-16 17:43