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

running ros on multiple machines

asked 2018-01-23 00:41:12 -0600

tr gravatar image

updated 2018-01-23 00:48:17 -0600

I have a Desktop and Raspberry Pi 3 connected via LAN cable. Both have static ip addresses assigned to them and host names have been added too.

On Desktop:

user@desktop:$ cat /etc/hosts   localhost   desktop   raspberrypi

On the Raspberry Pi:

pi@pi-desktop:$ cat /etc/hosts    localhost    pi-desktop    rosmaster

PublicKey Authentication is setup and I can ssh from the Desktop into the Raspberry Pi and vice-versa. Next the following variables were set:

On Desktop:

user@desktop:$ export ROS_MASTER_URI=
user@desktop:$ export ROS_IP=

On Raspberry Pi:

pi@pi-desktop:$ export ROS_MASTER_URI=
pi@pi-desktop:$ export ROS_IP=

Then I launched a talker node on Raspberry Pi and a listener node on the Desktop. I was able to hear/subscribe to the topic published by talker node. So far so good. Next goal was to write a launch file to launch the talker node on Raspberry Pi. The launch file looks like below:

  <machine name="pi" address="raspberrypi" env-loader="/opt/ros/kinetic/" user="pi"/>

  <node machine="pi" name="pi_talker" pkg="rospy_tutorials" type="" />


On launching this file, I get the following error :

user@desktop:~/ros_ws/src$ roslaunch ssh.launch 
... logging to /home/user/.ros/log/7f2d7002-ff6b-11e7-8dde-74d435d12cf4/roslaunch-desktop-12695.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[raspberrypi-0] starting roslaunch
remote[raspberrypi-0]: creating ssh connection to raspberrypi:22, user[pi]
/usr/lib/python2.7/dist-packages/Crypto/Cipher/ FutureWarning: CTR mode needs counter parameter, not IV
  self._cipher =, *args, **kwargs)
launching remote roslaunch child with command: [env ROS_MASTER_URI= /opt/ros/kinetic/ roslaunch -c raspberrypi-0 -u --run_id 7f2d7002-ff6b-11e7-8dde-74d435d12cf4]
remote[raspberrypi-0]: ssh connection created


 * /rosdistro: kinetic
 * /rosversion: 1.12.7

 * pi

    pi_talker (rospy_tutorials/


core service [/rosout] found
error launching on [raspberrypi-0, uri http://pi-desktop:45385/]: Name or service not known
Launch of the following nodes most likely failed: rospy_tutorials/

I felt that this may be due to the reason that location of the catkin_workspace on Raspberry Pi is not supplied anywhere. The workspace is located on /user/pi/catkin_workspace on Raspberry Pi. I added the line

source /home/pi/catkin_ws/devel/setup.bash

to file on RPi (since path to this file is supplied in launch file). So now looks like:

#!/usr/bin/env sh
# generated from catkin/cmake/templates/
source /home/pi/catkin_ws/devel/setup.bash

if [ $# -eq 0 ] ; then
  /bin/echo "Usage: COMMANDS"
  /bin/echo "Calling without ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-25 06:04:57 -0600

I don't know if this is still up to date but i had a pretty similiar problem.

I didn't have any host-names in my host file but I added the host-name of the raspberry pi. The only difference was that i wrote the same host-name on my desktop as it is in the hosts file on the raspberry. So your hosts file on Desktop should look like this:

user@desktop:$ cat /etc/hosts   localhost   desktop   pi-desktop
edit flag offensive delete link more

Question Tools



Asked: 2018-01-23 00:41:12 -0600

Seen: 1,120 times

Last updated: Jan 23 '18