Ask Your Question
3

ROS remote master: can see topics but no data

asked 2013-10-14 01:40:26 -0500

psei gravatar image

updated 2014-01-28 17:18:13 -0500

ngrennan gravatar image

Hi there,

I have got a question about running ROS on several machines. I currently have 4 systems:

Robot: 192.168.1.1
PC1: 192.168.1.2
PC2: 192.168.1.3
PC3: 192.168.1.4

Roscore/Rosmaster is running on the Robot and on all PCs I have set "export ROS_MASTER_URI=http://192.168.1.1:11311". Further more, all PCs can ping each other and it is possible to establish ssh connections.

Here comes the strange thing I do not understand: I can enter "rostopic list" on each PC, and I can see the topics that are running in the roscore on the robot. But when I enter "rostopic echo /someTopic", it only works for PC2. On PC1 and PC3 I don't receive any data. Why can I see the topics but can't receive/send messages?

The tutorial about ROS remote says, that it is only necessary that the PCs can ping each other and that nothing else except "ROS_MASTER_URI" needs to be configured.

Does anyone know why this is happening?

regards psei

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
6

answered 2013-10-14 03:24:04 -0500

dornhege gravatar image

The actual problem here is network resolution. Seeing the topics only shows you one direction of communication. Every computer needs to be able to talk to (test e.g. by ping) each other (from/to) using whatever name this is known by to ROS. That's what the ROS_IP settings are for.

edit flag offensive delete link more

Comments

2
tfoote gravatar imagetfoote ( 2013-10-14 16:33:22 -0500 )edit

I've run into the same issue and every time it was caused by messed up /etc/hosts file and/or lack of the ROS_IP export. If one does not export ROS_IP on the publishing PC, it should be possible to list the topics but you won't be able to establish a connection. This should be the answer.

autonomy gravatar imageautonomy ( 2013-10-15 06:25:56 -0500 )edit
1

I'm sorry, but I had the same issue and ROS_IP was set properly, it didn't make a difference. What made a difference is the /etc/hosts file on the remote PC having the hostname and ip of the master PC.

evk02 gravatar imageevk02 ( 2014-03-15 06:04:52 -0500 )edit
8

answered 2013-10-14 23:30:21 -0500

psei gravatar image

updated 2013-10-15 00:53:56 -0500

Hi everyone and thanks for your answers. I tried several things like setting ROS_IP, ROS_HOSTNAME, etc.... but I could not get it running.

What finally solved my problem was adding all PCs with their hostnames and IP Adresses to the "/etc/hosts" file. Since then, everything works fine.

edit flag offensive delete link more

Comments

1

I had the same issue. All ROS_IP, ROS_MASTER_URI settings were fine, I did see the topics but when subscribed no message came through. It was because the node running roscore had a hostname and that hostname was not added to the /etc/host file or the remote PC. I have added the hostname and the topics immediately started to show their data on the remote PC.

evk02 gravatar imageevk02 ( 2014-03-15 06:03:28 -0500 )edit

Thanks for posting an answer to your problem. Could you be more specific about what you did, though? You added IP addresses to /etc/hosts, but what did you do then? Just refer to the strings in ~/.bashrc? I'm having the same problem and any help would be wonderful.

mycal gravatar imagemycal ( 2015-03-20 12:37:44 -0500 )edit

This worked for me. Just add the publishing computer to the /etc/hosts file in the same format as the localhost is added.

Clancy gravatar imageClancy ( 2015-04-03 23:56:36 -0500 )edit
4

answered 2013-10-21 06:57:28 -0500

MadEgg gravatar image

updated 2013-10-21 06:59:42 -0500

The lack of data means that your client can see the ROS master, but cannot connect to the topics on the remote machine. The cause is that the services on the remote machine are not accepting remote connections, only local. This is determined by the ROS_IP variable.

So, to use ROS over network, you need do two two things:

On the machine running roscore, you need to make sure that your services listen on any port. When no port is set, localhost (127.0.0.1) is used. So, you should select the IP of your machine on the internal network, or listen on any interface:

export ROS_IP=0.0.0.0 # Listen on any interface

OR

export ROS_IP=192.168.1.1 # Listen on 192.168.1.1

On the machine running roscore, you needn't worry about ROS_MASTER_URI or ROS_HOSTNAME.

On the client machine, not running roscore, there's two things you need to do. First, you need to make sure that ROS nodes are able to connect to the master by specifying ROS_MASTER_URI:

export ROS_MASTER_URI=192.168.1.1:11311

Second, you need to make sure that nodes running on the remote machine can also access topics published on the local machine, by setting ROS_IP to something different than 127.0.0.1, so:

export ROS_IP=0.0.0.0 # To listen on any interface

edit flag offensive delete link more
0

answered 2013-10-14 02:33:23 -0500

Chrimo gravatar image

I'm using this and it works for me:

RemoteROS.sh

export ROS_HOSTNAME=/bin/hostname -I

export ROS_MASTER_URI="http://$1:11311"

echo Using ROS MASTER at $ROS_MASTER_URI from $ROS_HOSTNAME

ping -c 1 $1

rostopic list

export LIBGL_ALWAYS_SOFTWARE=1

edit flag offensive delete link more

Comments

Thx for your answer. As I wrote, "rostopic list" works, but not "rostopic echo /someTopic". I tried your script, it works, but I still can't use "rostopic echo"... I just don't get it. Any other ideas?

psei gravatar imagepsei ( 2013-10-14 02:46:42 -0500 )edit

Have you set ROS_IP or ROS_HOSTNAME? Do some of the PCs have Firewalls installed?

Ben_S gravatar imageBen_S ( 2013-10-14 03:07:59 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2013-10-14 01:40:26 -0500

Seen: 20,801 times

Last updated: Oct 21 '13