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

Rosrun, node is not removed from rosnode list after exit

asked 2012-07-04 10:47:29 -0500

WG- gravatar image

updated 2014-01-28 17:12:54 -0500

ngrennan gravatar image

Hello,

I am new to ROS and currently I'm following the tutorial of ROS. Everything went smooth till now. I am at tutorial: http://www.ros.org/wiki/ROS/Tutorials/UnderstandingNodes

At about in the middle you have to execute the command rosrun turtlesim turtlesim_node. Which will starte a node called turtlesim, because no other name is provided. Then you have to run rosrun turtlesim turtlesim_node __name:=my_turtle and execute the command rosnode list.

In the tutorial there is a note below the laste command saying

Note: If you still see /turtlesim in the list, it might mean that you don't have $ROS_HOSTNAME environment variable defined as described in Network Setup - Single Machine Configuration.

Now I still see /turtlesim in the list, even after I try to kill it using rosnode kill turtlesim. I however, believe, have the correct settings for Network Setup. After echoing the variables ROS_HOSTNAME (which value is localhost) and ROS_MASTER_URI (which value is http://localhost:11311)

Now can I just ignore this that /turtlesim was still in the list, even when it was closed? Because the ROS_HOSTNAME is definitly set correct.

-edit- maybe this can give some light on the matter at hand?

[22:54|0] $ roscore
... logging to /home/<user>/.ros/log/b4b75b6a-c61a-11e1-ab73-00216b29721e/roslaunch-<user>-29448.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://localhost:56819/
ros_comm version 1.8.10

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

NODES

auto-starting new master
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[master]: started with pid [29464]
ROS_MASTER_URI=http://localhost:11311/

setting /run_id to b4b75b6a-c61a-11e1-ab73-00216b29721e
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[rosout-1]: started with pid [29477]
started core service [/rosout]
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
8

answered 2012-07-04 12:35:53 -0500

How did you close the turtlesim?

When I did the tutorial I noticed that if I close the turtlesim with Ctrl+C from the console the node still remains open and is listed in 'rosnode list'. If you close the turtlesim by closing the window with the simulation, it properly closes (no more node listed in rosnode).

It could be that the process dies to fast when you use Ctrl+C so it does not perform the cleanup routines. I've seen similar behavior with other nodes as well, when they are killed with Ctrl+C but don't handle that properly.

edit flag offensive delete link more
0

answered 2016-11-19 08:26:05 -0500

rubanraj54 gravatar image

I also faced the same issue when I closed the turtle simulator by pressing CRTL+C from terminal, but the name of the node "/turtlesim" remains in the node list.

Then, I tried to kill the node manually by using rosnode kill command. But no use.

Finally, this command cleans up the unreachable node. "rosnode cleanup" This command remove the unreachable nodes from the ros server. Finally, the name of the node removed from the rosnode list.

link : http://wiki.ros.org/rosnode#rosnode_c...

edit flag offensive delete link more

Comments

that worked for me as well thanks

Anirudhkochhar gravatar image Anirudhkochhar  ( 2021-01-18 13:51:18 -0500 )edit

Question Tools

Stats

Asked: 2012-07-04 10:47:29 -0500

Seen: 2,521 times

Last updated: Jul 04 '12