ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Stopping a node by "Ctrl+C" doesn't update "rosnode list" command's result.

asked 2012-05-30 20:54:25 -0500

Seungeun Lee gravatar image

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

ngrennan gravatar image

hello everyone. i am new to ros. i just started studying ros. i'm following tutorials for beginner now, and i found one thing that doesn't seem to be right. there's a tutorial titled "Understanding ROS Nodes" and it showed me the way to stop a node by pressing "CTRL+C" and to display currently running nodes on the screen by "rosnode list" command. here is the question. if I stop a node by pressing "CTRL+C", shouldn't "rosnode list" command "NOT" display the node I just stopped? Apparently, it still displays the node although i stopped it. is this how it's supposed to be? or is this a bug?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-05-31 13:26:31 -0500

In the usual case this should not happen. If I am not mistaken, the node should unregister with the master when the last NodeHandle goes out of scope, and ros::shutdown() gets called. There might be a problem with the way your code is written which prevents this from happening. On the flip side, for most applications, a node that does not unregister should not constitute a problem.

To ensure that this is not a problem specific to the node you have written, try out some of the nodes already available in roscpp_tutorials. Try the following commands in order:

  1. Start roscore
  2. rosnode list
  3. rosrun roscpp_tutorials talker
  4. rosnode list
  5. Ctrl+C the talker node
  6. rosnode list

The rosnode list output for me looks something like this:

piyushk@piyushk-laptop:~$ rosnode list
piyushk@piyushk-laptop:~$ rosnode list
piyushk@piyushk-laptop:~$ rosnode list

If your output looks similar to that above, it may be a problem in the code you've written. If not, we can try and debug the problem.


edit flag offensive delete link more


Thanks for the answer~Piyush. I tried your suggestion and it worked fine as expected. The problem I mentioned earlier though happened when running "turtlesim_node"(of turtlesim package. a part of ros installation). so i guess it's a problem of something else. and i found out that the problem doesn't

Seungeun Lee gravatar image Seungeun Lee  ( 2012-05-31 22:20:43 -0500 )edit

happen with ROS electric. I didn't try out every version of ros but the problem that didn't happen with "electric" happens with "fuerte" version seems that it's the problem of "fuerte" version of ros. is there a place within the wiki I can report this bug(I think)? and thank you again Piyush:)

Seungeun Lee gravatar image Seungeun Lee  ( 2012-05-31 22:21:00 -0500 )edit

You should post this bug on trac:

piyushk gravatar image piyushk  ( 2012-06-01 09:29:41 -0500 )edit

answered 2012-06-03 08:12:05 -0500

Alex Bravo gravatar image

I just ran into the same issue too, in the same tutorial, while using Fuerte on a fresh Ubuntu-12.04, 64-bit.

When I used "rosnode info turtlesim", I saw: ... contacting node http://i7:56977/ ... ERROR: Communication with node[http://i7:56977/] failed!

I thought maybe it was because I did not have $ROS_HOSTNAME defined as described here: So I added export ROS_HOSTNAME=localhost

After that "rosnode info turtlesim" started working and gave me: ... contacting node http://localhost:60372/ ... Pid: 6178

I thought it was strange to see a different port number, but rosnode list started working too.

Then I went to the next tutorial and did "roscore" while other roscore was running.

Then I noticed that "rosnode list" again doesn't remove killed nodes and "rosnode info turtlesim" now gives: contacting node http://localhost:39889/ ... ERROR: Communication with node[http://localhost:39889/] failed!

Is the port number is not being set?

Seugen, did you file a bug for this?

edit flag offensive delete link more


sorry about late reply~ didn't file a bug yet:)

Seungeun Lee gravatar image Seungeun Lee  ( 2012-07-01 23:11:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-05-30 20:54:25 -0500

Seen: 2,783 times

Last updated: Jun 03 '12