Hi Felix, <br><br><div class="gmail_quote">On Fri, Jul 8, 2011 at 1:13 AM, Felix Ruess <span dir="ltr"><<a href="mailto:felix.ruess@gmail.com">felix.ruess@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi,<br>
<br>
how can I cleanly shutdown/unload a nodelet from within the nodelet<br>
code under diamondback?<br>
<br></blockquote><div>There is not currently a way to do this cleanly, it's ticketed as an enhancement at <a href="https://code.ros.org/trac/ros-pkg/ticket/4431">https://code.ros.org/trac/ros-pkg/ticket/4431</a><br> <br>

</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
In the onInit() function of the nodelet I instantiate a class, which<br>
will immediately return from the constructor if a parameter file is<br>
not found and the nodelet should be shutdown/unloaded.<br>
<br>
What I did so far is to call ros::requestShutdown before returning<br>
from the constructor, is this the correct way of doing this?<br>
At least this seems to partially work, the nodelet destructor is<br>
called and the process finishes cleanly after a time.<br>
I'm wondering why it is taking so long for the process to finish<br>
cleanly after the nodelet destructor was already called? Does this get<br>
detected via some timeout of bind?<br>
<br>
The actual problem though is that after the nodelet is destroyed I<br>
can't seem to reach the nodelet manager anymore to load new nodelets.<br>
Even trying to shut it down normally via CTRL-C doesn't quite work,<br>
after a while I get an "escalating to SIGTERM" message.<br>
<br>
What's the correct way to do this?<br>
<br></blockquote><div><br>This is not a good way to take down a nodelet, because requestShutdown is taking down the entire Node, aka all ROS in the process, including the manager and any other nodelets.  <br><br>The best solution right now is to call the unloadNodelet service on the manager.  <br>

<br>Tully <br>
</div></div><br>