Ask Your Question

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 (, for example), but they're not answering this question for me.)

Thank you.

edit retag flag offensive close merge delete


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 image Tom Sgouros  ( 2012-11-13 06:24:18 -0500 )edit

8 Answers

Sort by ยป oldest newest most voted

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

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

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 = - 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_IP= (empty data)

and it works!

and if you want use matlab - our PC with matlab RPI with ROS and sensors

setenv('ROS_MASTER_URI','') setenv('ROS_IP','') setenv('ROS_HOSTNAME','')

edit flag offensive delete link more

answered 2019-11-18 08:14:05 -0500

benwex93 gravatar image

In my case it was a matter of my client not being able to resolve the IP address of my server. I was able to verify this by subscribing to a topic and then checking the info about that topic:

$rostopic info /gazebo/model_states

Type: gazebo_msgs/ModelStates

 * /gazebo (http://my-workstation:42193/)

 * /rostopic_117_1574085827847 (

I had passed to my client as ROS_MASTER_URI but my server publishes as 'my-workstation' and not It's clear then that the Ros Master was unable to connect the topic listener and publisher to listen and publish to the same port because it cant resolve what 'my-workstation' is referring to.

So my solution was to add my-workstation

to the end of etc/hosts on my client and now it works

edit flag offensive delete link more

answered 2015-05-09 08:35:10 -0500 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


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

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

This worked for me, either! For my case ROS_MASETER_URI setting for base machine itself was not necessary. Also ufw disable(turn off firewall) and etc/hosts file did not affect my result.

Harestew gravatar image Harestew  ( 2020-05-02 03:43:13 -0500 )edit

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

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

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


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

Seen: 12,254 times

Last updated: Nov 18 '19