0
$\begingroup$

Rosanswers logo

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.


Originally posted by Tung Nguyen on ROS Answers with karma: 183 on 2012-11-10

Post score: 3


Original comments

Comment by tlinder on 2012-11-10:
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.

Comment by SL Remy on 2012-11-11:
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 and echo $ROS_MASTER_URI in all the terminals that you are using.

Comment by Tung Nguyen on 2012-11-11:
@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!

Comment by Tung Nguyen on 2012-11-11:
@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!

Comment by Tung Nguyen on 2012-11-11:
@felix k: No, now it even doesn't make it to the master. ERROR: Unable to communicate with master! Nothing is running yet.

Comment by Tung Nguyen on 2012-11-11:
@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!

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

Are you sure your /turtlesim node isn't still running? Check via rosnode cleanup or pgrep turtlesim_node.

And: you set ROS_MASTER_URI to localhost, and the turtlesim_node is trying to reach localhost. I don't see it having changed?


Originally posted by felix k with karma: 1650 on 2012-11-11

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

Did you check all the steps at:

http://www.ros.org/wiki/ROS/NetworkSetup

Also i had some trouble with some entries in the /etc/hosts file since the entries there usually overwrite the information from the DNS/DHCP Server. If you have some entries there, you can make a backup of your /etc/hosts file and delete every entry except the following:

127.0.0.1   localhost

At least this was the cause for a similar problem in a network with non-static IP addresses....


Originally posted by michikarg with karma: 2108 on 2012-11-11

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

Oh, i see it now! My mistake. I closed the window containing the roscore command, so there's no master initialized at all. Hence the trouble.

Thank you all for tolerating my silliness!


Originally posted by Tung Nguyen with karma: 183 on 2012-11-11

This answer was NOT ACCEPTED on the original site

Post score: 15

$\endgroup$

Your Answer

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