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

Revision history [back]

I don't really get how this script works. Executing it once prints the first echo statement, executing it a second time only prints the second statement. Must be my lack of bash script understanding.

Anyway, I put together a simple script that does the job for me:

#!/bin/bash

export ROS_ROOT=<ros-root>
export ROS_PACKAGE_PATH=<ros-package-path>
export ROS_IP=<ip>
export ROS_MASTER_URI=<master-uri>

exec "$@"

This script should be placed on the remote computer. In the machine file, remove all definitions of ros-* variables, and use the env-loader="<path-to-script-on-remote-pc>" attribute, e.g.

<launch>
  <machine name="<machine-name>" env-loader="<path-to-env-script>" address="<remote-ip>" user="<username>">
  </machine>
</launch>