Ask Your Question
1

rostopic list works but rostopic echo does not

asked 2012-11-13 06:05:21 -0500

Tom Sgouros gravatar image

updated 2012-11-13 09:18:11 -0500

Ben_S gravatar image

I'm running the ROS core on a mobile robot and am using ssh to monitor it from a workstation. On the workstation I have ROS_MASTER_URI and ROS_IP configured per the wiki's instructions to point at the robot's IP address. "rostopic list" works correctly and shows me the correct list of topics. Unfortunately, "rostopic echo" is silent, and "rxgraph" also implies the workstation is not connected to the host.

The question: under what circumstances could rostopic list work and rostopic echo not work?

(I'm familiar with the relevant sections of the wiki (http://www.ros.org/wiki/ROS/NetworkSetup, for example), but they're not answering this question for me.)

Thank you.

edit retag flag offensive close merge delete

Comments

Just to elaborate, I can edit /etc/hosts on both machines to make this work, but the network setup page implies I should be able to do this by setting ROS_IP, which does not seem to work. I don't have su privilege on all the machines I want to use.

Tom Sgouros gravatar imageTom Sgouros ( 2012-11-13 06:24:18 -0500 )edit

7 Answers

Sort by ยป oldest newest most voted
3

answered 2012-11-13 08:12:57 -0500

jbohren gravatar image

updated 2012-11-13 08:13:39 -0500

$ROS_IP on your workstation should be your workstation's IP address, not the robot's.

rostopic list is just talking to the master, whereas rostopic echo needs to be able to communicate with the publishers.

edit flag offensive delete link more
2

answered 2015-07-14 16:51:31 -0500

Thomas10111 gravatar image

Adding the ros server to the /etc/hosts file on the client worked for me.

edit flag offensive delete link more
1

answered 2014-04-15 16:53:31 -0500

Younghyo gravatar image

I undergo the same problem. You also should set $ROS_IP on mobile robot. It works.

edit flag offensive delete link more
1

answered 2012-11-13 09:57:51 -0500

Ben_S gravatar image

$ROS_IP and $ROS_HOSTNAME basically tell the nodes running on a computer on which address they are reachable from the outside. You need to set only one of those. Whatever works better in your network. (To be absolutely sure and if you can use static IPs, i prefer using IP addresses)

So make sure, that you can ping in both directions and set $ROS_IP on the server and the workstation each to their externally reachable addresses.

jbohren already mentioned what constellation can lead to the observed behaviour. rostopic list is completely independent from the setting of $ROS_IP. It only needs an correctly set $ROS_MASTER_URI. :)

edit flag offensive delete link more
1

answered 2017-03-31 09:11:21 -0500

Wiew gravatar image

Check your settings in both terminal. We had same problem and problem was in :

We had in 1st terminal ROS_MASTER_URI =http://192.168.1.10:11311 - in this terminal runs roscore and in 2nd terminal ROS_MASTER_URI =http://localhost:11311 - in this terminal runs urg_node

In matlab we receive using rostopic list all nodes but if we use rostopic echo /scan, we are not able to receive data.

there is our solution: best way how eliminate similiar mistakes is add few lines to .bashrc file

export ROS_MASTER_URI=http://192.168.1.10:11311

export ROS_HOSTNAME=192.168.1.10

export ROS_IP= (empty data)

and it works!

and if you want use matlab

192.168.1.11 - our PC with matlab 192.168.1.10 RPI with ROS and sensors

setenv('ROS_MASTER_URI','http://192.168.1.10:11311') setenv('ROS_IP','192.168.1.11') setenv('ROS_HOSTNAME','192.168.1.11')

edit flag offensive delete link more
0

answered 2015-05-09 08:35:10 -0500

charles.fox gravatar image

I just had this issue when I moved my computers onto a new network, where they got assigned new nonstatic IPs by DHCP. The fix which worked for me was:

set ROS_HOSTNAME on robot PC to its own ip,

set ROS_HOSTNAME on base PC to its own ip

set ROS_IP on robot PC to base IP

set ROS_MASTER_URI to base IP:11311 both machines.

edit flag offensive delete link more

Comments

Thanks for your answer! I got headache with other solutions but this does help me!

lhnguyen gravatar imagelhnguyen ( 2017-06-13 09:17:37 -0500 )edit
0

answered 2019-07-16 11:29:41 -0500

sai krishna gravatar image

even after the correct settings of ROS_MASTER_URI and ROS_IP to the base workstation you would some times not receive the data and rostopic list works but not rostopic echo

in order to work on this issue you'll have to add an exception in your firewall settings for the robot's IP connection or disable the firewall using the command : sudo ufw disable

it should definitely work !

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2012-11-13 06:05:21 -0500

Seen: 9,368 times

Last updated: Jul 16