[ros-users] nodelet shutdown/unload itself, requestShutdown

Felix Ruess felix.ruess at gmail.com
Fri Jul 8 08:13:48 UTC 2011


how can I cleanly shutdown/unload a nodelet from within the nodelet
code under diamondback?

In the onInit() function of the nodelet I instantiate a class, which
will immediately return from the constructor if a parameter file is
not found and the nodelet should be shutdown/unloaded.

What I did so far is to call ros::requestShutdown before returning
from the constructor, is this the correct way of doing this?
At least this seems to partially work, the nodelet destructor is
called and the process finishes cleanly after a time.
I'm wondering why it is taking so long for the process to finish
cleanly after the nodelet destructor was already called? Does this get
detected via some timeout of bind?

The actual problem though is that after the nodelet is destroyed I
can't seem to reach the nodelet manager anymore to load new nodelets.
Even trying to shut it down normally via CTRL-C doesn't quite work,
after a while I get an "escalating to SIGTERM" message.

What's the correct way to do this?

Cheers, Felix

More information about the ros-users mailing list