Echo ROS topics from a remote roscore

I needed to display some topics registered to my the roscore on the raspi on my main computer for debugging and visualization. That should have been easy in theory, as simple as exporting the ROS_MASTER_URI on my main computer:

[code]export ROS_MASTER_URI=http://raspberrypi:11311[/code]

However after that I was able to list the topics with:

[code]rostopic list[/code]

But I couldn’t echo the topic with:

[code]rostopic echo /imu_quat[/code]

there was simply no output. Directly exporting the IP in the master uri to avoid the name resolution didn’t help either.

The trick was to use a name and to make sure it gets resolved locally ?!?
You can achieve that by editing your hosts file:
[code]sudo nano /etc/hosts[/code]
There you should add something like:
[code]192.168.181.12 raspberrypi[/code]

I hope this saves other people some time.

Schreibe einen Kommentar