0
$\begingroup$

Rosanswers logo

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?


Originally posted by Seungeun Lee on ROS Answers with karma: 35 on 2012-05-30

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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
/rosout
piyushk@piyushk-laptop:~$ rosnode list
/rosout
/talker
piyushk@piyushk-laptop:~$ rosnode list
/rosout

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.

Piyush


Originally posted by piyushk with karma: 2871 on 2012-05-31

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Seungeun Lee on 2012-05-31:
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

Comment by Seungeun Lee on 2012-05-31:
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:)

Comment by piyushk on 2012-06-01:
You should post this bug on trac: https://code.ros.org/trac/ros/

$\endgroup$

Your Answer

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