0
$\begingroup$

Rosanswers logo

I just added a 2nd machine to my ROS network and went through all of the appropriate tutorials on making sure the two could ping each other ( http://wiki.ros.org/ROS/NetworkSetup#Configuring_.2BAC8-etc.2BAC8-hosts). On my second machine i have exported the master URI and can echo ros topics running on the master just fine. When i try to publish onto a new topic from the second machine, the master can see the new topic exists, but if i try to echo it the master is unable to receive any information.

This forum seemed to address my exact problem, (http://answers.ros.org/question/90536/ros-remote-master-can-see-topics-but-no-data/). They suggest adding the master computer to the etc/host file on the 2nd machine. My problem now is that i can't seem to properly edit the etc/host files! Can anyone provide a good tutorial on how to do this? I have tried several different ways and i'm sure i'm not doing it properly. <--edit 7/10/17: I'm led to believe this is not the real issue. See edit below

Thanks!

EDIT: Okay i have editing the /etc/host file and can now successfully ping the host machine from the 2nd machine via its alias. I can also export ROS_MASTER_URI=alias:11311 and can access the ROS network from the 2nd machine. Still have the same problem though: 2nd publishes to a new topic, master sees new topic, but when master echoes new topic nothing is received


Originally posted by Ryan_F on ROS Answers with karma: 71 on 2017-07-09

Post score: 1


Original comments

Comment by Ed Venator on 2017-07-09:
"My problem now is that i can't seem to properly edit the etc/host files!"

Can you elaborate? How are you trying to edit /etc/hosts? What happens?

Comment by Ryan_F on 2017-07-10:
I think i got it to work since i can now ping the master from the 2nd machine via its alias, and can also export ROS_MASTER_URI using the master alias. So editing the /etc/hosts file may not be my problem anymore. I will update my question to reflect this. Thanks

Comment by gstavrinos on 2017-07-11:
You need to edit the /etc/hosts file for both machines!

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

In order to be sure that your machines can communicate successfully, I would advice to also export the ROS_IP parameter in each machine's .bashrc.

Regarding your question on how to edit the /etc/hosts file, it is simple as just running: sudo nano /etc/hosts


Originally posted by gstavrinos with karma: 641 on 2017-07-10

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Ryan_F on 2017-07-10:
I always export the proper IP in every terminal i open. I have also made sure i reset the DNS after and i still have the same issue. 2nd machine publishes to a new topic, master sees the new topic but when "echoed" nothing is received. 2nd machine can also ping master via its alias.

$\endgroup$
0
$\begingroup$

Rosanswers logo

My problem turned out to be that i was exporting the wrong ROS_IP address on the 2nd machine.

After editing the /etc/hosts file on the 2nd machine to include the host machine, and exporting the ROS_MASTER_URI=http://hostalias:11311 (on the machine not running roscore) you need to export the proper ROS_IP's on BOTH machines so ROS knows where to listen. To do this:

  1. Identify the IP address of each machine
  2. export ROS_IP=ipaddress of each machine in any terminal you use to communicate with ROS. Make sure that you are exporting the IP address of the respective machine. My problem was that i was exporting the host computer's IP address in both machines!

After taking those steps you should be able to both publish, and subscribe to topics from a 2nd machine.

Hope that helps!


Originally posted by Ryan_F with karma: 71 on 2017-07-11

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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