Failed to contact master at [localhost:11311]
Hi everybody,
This is the first time i'm here, so if my question is too dumb to you, please forgive me. I'm on track "Understanding Nodes" in the beginner tutorials. After changing the name of the turtlesim node via:
$ rosrun turtlesim turtlesim_node __name:=my_turtle
I opened a new terminal and run:
rosnode list
and the results are:
/my_turtle
/turtlesim
/rosout
which is undesired, since the turtlesim node had been changed to my_turtle. The ROS folks knew about it and suggested us to update ROS_HOSTNAME and i did:
$ export ROS_HOSTNAME=localhost
$ export ROS_MASTER_URI=http://localhost:11311
Now not only the problem is still not solved, but another one also occurs. I can't even run the turtlesim node which is previously valid:
$ rosrun turtlesim turtlesim_node
Here is what's wrong:
[ERROR] [1352578402.235275857]: [registerPublisher] Failed to contact master at [localhost:11311]. Retrying...
It looks like the ROS_MASTER_URI has been updated unexpectedly! The main problem now is i don't know how to set it back to default.
Most of you have completed the tutorials and some of you must have stuck on this. So, please share with me how you tackle the problem! I really appreciate that.
Hi, can you ping the localhost ? If not check your Hosts-file in /etc/hosts and may reconfigure it to default. Also it is not realy needed to make use of the ROS_HOSTNAME settings, so may do not use this command for the next time.
Also, where/how did you change the hostname and uri? If for some reason you have different settings in different terminals this would cause communication issues as well. To chech type
echo $ROS_HOSTNAME
andecho $ROS_MASTER_URI
in all the terminals that you are using.@trinighost: I changed it in the export double command above. Yes, now it returns localhost:11311 for the ROS_MASTER_URI query. Please, help me!
@tlinder: Yes, i still can ping the host. Yes, i will be careful next time. For this time, i tried to change the hostname to my System name, IP address but things still doesn't work!
@felix k: No, now it even doesn't make it to the master. ERROR: Unable to communicate with master! Nothing is running yet.
@michikarg: Yep, I check self-ping but i didn't work. So i try Name Resolution as suggested and changed the Hostname and associated Master URI to the System name and the IP address. But nothing seemed to be a good choice so far!