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

Why is my_turtle alive even after I finished it?

asked 2017-03-22 11:00:47 -0600

I am lerning ROS from scratch following this: http://wiki.ros.org/ROS/Tutorials/Und...

first I did:

$ rosnode list

and the output was:

/rosout

then I started the Turtle:

$ rosrun turtlesim turtlesim_node

$ rosnode list

and the output was:

/rosout

/turtlesim

then I killed the Turtle doing control+C

and started a new turtle with my custom name:

$ rosrun turtlesim turtlesim_node __name:=my_turtle

bust afer calling rosnode list I see 3 turtles running, but the oldone is not there since I can not do a ping on it... what am doing wrong?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2017-03-23 08:24:36 -0600

updated 2017-03-25 00:49:27 -0600

Well I've found the reason why:

the correct way (or the cleanest way) to finish the execution of a node is actually invoking the command:

$rosnode kill <node_name>

this will gently invoke the dispose in the node which among others release resources, dispose itself and "Disconnect from the Master"-- Ha! that is very important!

Since I can terminate the application (the node is an application too) by doing Control+ C, I've faced the issue that this method doesn't give a chance to the node to dispose itself properly, this is the reason why the zombie node is still visible when I do:

$rosnode list

anyways, the hole graph can be updated / cleaned and the "zombie node" can be removed after calling a

$rosnode cleanup

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-22 11:00:47 -0600

Seen: 214 times

Last updated: Mar 25 '17