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

"ERROR: Unable to communicate with master!" and "Unable to Register with master node"

asked 2023-05-25 07:31:26 -0500

mericgeren gravatar image

updated 2023-05-26 04:44:00 -0500

Hello,

I have two computers on a local network. First of them has Ubuntu 18.04 as OS, ROS Melodic installed and connected to the network with an Ethernet cable. The other one has Windows 10 as OS, ROS Noetic installed and connected to the same network with WIFI. I want to publish some message from the computer with Ubuntu into the other one with Windows 10 running a master with "roscore". To achieve this, i have changed ROS_MASTER_URI, ROS_IP and ROS_HOSTNAME to ones of the computer with Windows 10 from ".bashrc" using:

export ROS_HOSTNAME

export ROS_MASTER_URI

export ROS_IP

Then, i started my ros master in the computer with Windows 10 using the command "roscore" and then, in the terminal of PC with Ubuntu, i entered:

/usr/bin/python /home/theUser/catkin_ws/src/myProject/scripts/RosPublisher.py

to run my publisher code written in Python. Which will initialize my node with:

rospy.init_node("thePublisher", anonymous = True)

then, prepare and publish my message.

After, running my code i got the following error:

Unable to register with master node [http://computer:11311]: master may not be running yet. Will keep trying.

Then, when i want to check topics with "rostopic list" i see:

ERROR: Unable to communicate with master!

Can you help me with this issue please?

Thanks in advance.

P.S. For setting ROS_HOSTNAME, ROS_MASTER_URI and ROS_IP, i used simply "set ROS_HOSTNAME", "set ROS_MASTER_URI" and "set ROS_IP" in my cmd terminal (created by using steps specified there: link text)

edit retag flag offensive close merge delete

Comments

1

Did you set ROS_IP to the IP of the system that terminal is in or the IP of machine running master? I’ve seen users set the ROS_IP the same for both machines, which is wrong.

chased11 gravatar image chased11  ( 2023-05-26 17:42:38 -0500 )edit

On both systems my ROS_HOSTNAME, ROS_MASTER_URI and ROS_IP is set to ones of the system running ROS master. Could you explain what do you mean when you say setting the same ROS_IP for both machines is wrong? Do you say i should set ROS_IP of each system to their own IP or you say i should set my ROS_IP of each system to IP of the other system?

Thanky for the support you have offered.

mericgeren gravatar image mericgeren  ( 2023-05-27 21:56:49 -0500 )edit
1

Do you say i should set ROS_IP of each system to their own IP

yes.

On both systems my ROS_HOSTNAME, [..] and ROS_IP [..]

there's no need to set both ROS_HOSTNAME and ROS_IP.

If you have working DNS, set ROS_HOSTNAME. If not, set ROS_IP.

ROS_HOSTNAME and ROS_IP tell your ROS nodes about the IP configuration of the PC you set them on, not of the master.

OnlyROS_MASTER_URI should "point" to where roscore is running.

(think about it: why would there be three configuration variables all containing the exact same information?)

gvdhoorn gravatar image gvdhoorn  ( 2023-05-28 01:30:21 -0500 )edit

Thank you gvdhoom and chased11 so much for your kind help.

After setting only ROS_IP and ROS_MASTER_URI for each device (ROS_IPs set to their own ips for each device and ROS_MASTER_URI is set to http://(ip address of master):11311 for each device) i am able to connect to ros master from the other computer and can subscribe to the topic from there.

mericgeren gravatar image mericgeren  ( 2023-05-29 03:54:36 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2023-05-29 03:53:48 -0500

mericgeren gravatar image

Thank you gvdhoom and chased11 so much for your kind help.

After setting only ROS_IP and ROS_MASTER_URI for each device (ROS_IPs set to their own ips for each device and ROS_MASTER_URI is set to http://(ip address of master):11311 for each device) i am able to connect to ros master from the other computer and can subscribe to the topic from there.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-05-25 07:31:26 -0500

Seen: 511 times

Last updated: May 29 '23