0
$\begingroup$

Rosanswers logo

I am attempting to combine two tutorials from the Wiki: MultipleMachines and UnderstandingTopics.

I have one Ubuntu 13.04 / Hydro Master VM running roscore + turtlesim + turtle_teleop_key + rostopic echo /turtle1/cmd_vel. On it I have exported ROS_HOSTNAME='x.x.x.x' with the IPv4 address set appropriately.

I have another Ubuntu 13.04 / Hydro Slave VM with ROS_MASTER_URI set to the master machine. I have run roswtf and rostopic list -v and rostopic info /turtle1/cmd_vel and validated that the results seem to be correct, the ip addresses are expected.

On the slave, I run:

rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

and it never returns. The message is not received on the master by rostopic echo and the turtle doesn't move. If I issue the same rostopic pub on the master itself, it works as expected.

I have run the diagnostic steps (ssh/ping/netcat) from NetworkSetup and validated that Master and Slave have proper network connectivity between them.

Are there any steps I have missed? Is a slave rosrun supported but slave rostopic pub not supported?

Thanks in advance for any help you can offer.


Originally posted by Jay Beavers on ROS Answers with karma: 3 on 2013-10-09

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You don't mention setting the ROS_HOSTNAME for the second machine. I suspect that is your problem ROS requires bidirectional hostname lookups. There's a debugging guide here: http://wiki.ros.org/ROS/NetworkSetup

You can get the asymmetric counter intuitive behavior because under the hood the subscriber contacts the publisher to establish communications. So the important hostname is actually the publisher's not the subscriber's.


Originally posted by tfoote with karma: 58457 on 2013-10-09

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Jay Beavers on 2013-10-10:
Thank you for helping to clear that up. Indeed, ensuring that ROS_HOSTNAME was set properly on the Slave node is what made things work.

Thanks for your prompt assistance.

Comment by Jay Beavers on 2013-10-10:
As part of fixing this, I installed avahi-daemon and used .local addresses between the two nodes. Do you think this technique is worth mentioning as part of a 'getting started with multi machine' tutorial?

Comment by tfoote on 2013-10-10:
.local is often something that I use myself. I've avoided using it in the docs because it sometimes won't work and it opens up a large amount of debugging in those cases.

Also please accept the answer at the left using the checkbox so it is removed from the unanswered list and others don't spend time to try to answer it again.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.