Ask Your Question
1

Unable to communicate with master with ROS on Multiple Machines but ROS_MASTER_URI are set and roscore is running

asked 2020-09-19 11:17:06 -0500

nerii gravatar image

updated 2020-09-20 02:11:04 -0500

gvdhoorn gravatar image

Hi everyone! I'm sorry if my english is bad but I'm French. It's been 2 days that I can't understand why I can't run ROS accross my 2 machines, while I did everything that we have to do... So I have 2 computers with Ubuntu 16.04 and ROS on each of them, and I would like to test the 2 nodes, talker.py and listener.py.

I have my first computer, the master, where roscore is running and listener.py too. I wrote on the file bashrc those 3 lines :

export ROS_MASTER_URI=http://My IP Adress of my master computer:11311
export ROS_HOSTNAME=My IP Adress of my master computer
export ROS_IP=My IP Adress of my master computer

And i have my second computer, the slave, where talker.py is running. I wrote on the file bashrc those 3 lines :

export ROS_MASTER_URI=http://My IP Adress of my master computer:11311
export ROS_HOSTNAME=My IP Adress of my master computer
export ROS_IP=My IP Adress of my slave computer

The 2 computers are connected on the same WiFi but when I run talker.py on the slave computer, it says : "unable to immediately register with master node [http:// ...mi master IP adress.....]: master may not be running yet. Will keep trying"

I spent 2 days to look on every websites to understand what could be the problem and I did everything that they say on the forums but nothing work and i really really do not understand i'm so desperate

hope you can help me

thank you so much

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-09-20 02:16:19 -0500

gvdhoorn gravatar image

tl;dr: remove the export ROS_HOSTNAME=.. lines from the .bashrc files of both computers. If what you show here is really what you have in those files, then start new shells and things should start working.


Longer:

I have my first computer, the master, where roscore is running and listener.py too. I wrote on the file bashrc those 3 lines :

export ROS_MASTER_URI=http://My IP Adress of my master computer:11311

This is corect.

export ROS_HOSTNAME=My IP Adress of my master computer
export ROS_IP=My IP Adress of my master computer

This is not really correct (or at least: not really needed): if you're specifying IP addresses, only use ROS_IP. If you're using hostnames everywhere, only set ROS_HOSTNAME.

So remove the export ROS_HOSTNAME=.. line.

And i have my second computer, the slave, where talker.py is running. I wrote on the file bashrc those 3 lines :

export ROS_MASTER_URI=http://My IP Adress of my master computer:11311

This is correct.

export ROS_HOSTNAME=My IP Adress of my master computer

This is incorrect.

Apart from what I mentioned earlier about not setting ROS_HOSTNAME to an IP address, you're also using the "adress of [your] master computer".

Both ROS_HOSTNAME as well as ROS_IP must be set to the hostname and IP address of the machine itself, not of any other machine in your network.

Only ROS_MASTER_URI could contain an IP address or hostname of another machine, and then only when the master is actually running on some other host (such as in your case).

export ROS_IP=My IP Adress of my slave computer

This would again be correct.

edit flag offensive delete link more

Comments

Hello, I'm having a similar problem to this problem, did you find the answer? Here is my configuration in bashrc: master computer: export ROS_IP=192.168.101.1 export ROS_MASTER_URI=http://192.168.101.1:11311 slave computer: export ROS_IP=192.168.101.2 export ROS_MASTER_URI=http://192.168.101.1:11311 and I can run roscore on master pc, but when running launch on my slave computers, I get Unable to communicate with master warning. I would be glad if you help. @gvdhoorn@nerii

SuleKayiran gravatar image SuleKayiran  ( 2021-07-28 06:47:08 -0500 )edit

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: 2020-09-19 11:17:06 -0500

Seen: 368 times

Last updated: Sep 20 '20