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

fuerte machine tag changes

asked 2012-04-05 04:00:35 -0500

rep 124 describes the changes made in the machine tag syntax in the ROS fuerte release [1], and states:

The env-loader file must be an executable script that accepts variable-length arguments. After performing environment setup, the script must then execute its arguments as a command. ROS installations come with a default environment loader file.

Can someone give an example of how such a script would typically look like?

[1] http://ros.org/reps/rep-0124.html#machine-tag

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-04-05 22:08:00 -0500

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>
edit flag offensive delete link more
1

answered 2012-04-05 05:16:05 -0500

joq gravatar image

A good question. I don't know a good answer.

We can get some hints from the default script provided in /opt/ros/fuerte/env.sh:

#!/bin/sh

if [ $# -eq 0 ] ; then
    /bin/echo "Entering environment at /opt/ros/fuerte"
    . /opt/ros/fuerte/setup.sh
    $SHELL
    /bin/echo "Exiting build environment at /opt/ros/fuerte"
else
    . /opt/ros/fuerte/setup.sh
    exec "$@"
fi

I suspect that one could add additional environment definitions using a similar script.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-04-05 04:00:35 -0500

Seen: 642 times

Last updated: Apr 05 '12