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

launch file to run multiple nodes in two machines: problem with environment file

asked 2015-01-21 02:10:23 -0600

altella gravatar image

updated 2015-01-21 16:10:18 -0600

Hello all;

Following this good tutorial, link tutorial,

I have made a roslaunch file to start diferent nodes, locally and remotely in a Raspberry Pi. My launch file is:

<!-- at_robot_system.launch -->

    <machine name="at_robot_server" address="" user="alberto" password="altella" env-loader="/home/alberto/"/>
    <machine name="at_robot" address="" user="pi" password="raspberry" env-loader="/home/pi/"/>

    <group ns="at_robot_server">
        <node machine="at_robot_server" pkg="at_robot_server" name="KeyController_node" type="KeyController" output="screen">
            <param name="loop_rate" value="20" type="int"/>
            <param name="up_key" value="56" type="int"/>
            <param name="down_key" value="50" type="int"/>
            <param name="left_key" value="52" type="int"/>
            <param name="right_key" value="54" type="int"/>
        <node machine="at_robot" name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
            <remap from="image" to="/image_raw"/>
            <param name="autosize" value="true"/>

    <group ns="at_robot">
        <node machine="at_robot" pkg="uvc_camera" type="uvc_camera_node" name="uvc_camera" output="screen">
            <param name="device" value="/dev/video0"/>  
            <param name="width" value="640"/>
            <param name="height" value="480"/>
            <param name="format" value="jpeg"/>
            <param name="fps" value="30"/>
            <param name="auto_focus" value="False"/>
            <param name="focus_absolute" value="0"/>
        <node machine="at_robot" pkg="at_robot" type="KeyControlClient_node" name="KeyControlClient" output="screen">
            <param name="motor_motion_time" value="100" type="int"/>


Both sections of the launch file work independently when launched locally. But running this launch file, I have the following error, which I can not understand, beacuse all the files exist and are checked with right persmissions:

alberto@alberto-pc:~$ roslaunch at_robot_server at_robot_system.launch
... logging to /home/alberto/.ros/log/99a32f48-a0f1-11e4-855a-080027cab213/roslaunch-alberto-VirtualBox-3229.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server
remote[] starting roslaunch
remote[]: creating ssh connection to, user[pi]
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://localhost:11311 /home/pi/ roslaunch -c -u --run_id 99a32f48-a0f1-11e4-855a-080027cab213]
remote[]: ssh connection created
remote[]: env: /home/pi/ No such file or directory

[] process has died
remote roslaunch failed to launch: at_robot

My environment sh files are as follows:


export ROS_IP=
export ROS_MASTER_URI=http://localhost:11311
. /home/alberto/at_robot_ws/devel/
exec "@"

Is there any error? Would it be better to use bash?

Could anyone give a hint? Thank you very much in advance,


edit retag flag offensive close merge delete


I have used dos2unix tool with the sh files, just in case. Now I have this error:

remote[]: /home/pi/ 6: exec: @: not found

What does it mean?

altella gravatar image altella  ( 2015-01-21 16:08:26 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2015-01-21 16:21:18 -0600

ahendrix gravatar image

the last line in your environment loader should be:

exec "$@"

Note that you're missing the $

edit flag offensive delete link more


I will test it this evening, but you are right... it seems to be the problem. I´ll let you know.

altella gravatar image altella  ( 2015-01-22 01:43:42 -0600 )edit

Ecactly, that was de problem. Thank you very much for the tip. I am not experienced in bash or sh, what does the instructions "." and "exec "$"" exactly mean?

altella gravatar image altella  ( 2015-01-23 02:16:56 -0600 )edit

. is a synonym for source. exec is the same as the exec() system call in C. "$@" expands to all of the positional arguments to the script.

This causes the script to set up the environment, and then execute the arguments as a new command.

ahendrix gravatar image ahendrix  ( 2015-01-23 14:46:13 -0600 )edit

Question Tools

1 follower


Asked: 2015-01-21 02:10:23 -0600

Seen: 3,993 times

Last updated: Jan 21 '15