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:
- Start roscore
- rosnode list
- rosrun roscpp_tutorials talker
- rosnode list
- Ctrl+C the talker node
- 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/