ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.