<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
 * Is it OK for onInit() to return when initialization finishes? That<br>
looks like the nodelet_tutorial_math example, which runs onInit()<br>
followed by callback invocations. (I assume "yes". My<br>
pointcoud_nodelet works the same way. )<br></blockquote><div><br></div><div>onInit() is required to return</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<br>
 * Are the callbacks invoked in the nodelet thread (by default),<br>
similar to a node? (I assume "yes".)<br></blockquote><div><br></div><div>This depend on which nodehandle you use.  The one returned by get(Private)NodeHandle() guarantees that callbacks will not happen in multiple threads at once, but the thread they're called from may be different from call to call.</div>

<div><br></div><div>The one returned by getMT(Private)NodeHandle() allows callbacks in multiple threads at the same time.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<br>
 * Is there any special hook for shutting down a nodelet? I don't see<br>
anything like an onExit() method.<br></blockquote><div><br></div><div>The destructor.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
 * Can a device driver run its entire main loop in the onInit() method<br>
using "while (ros::ok()) { ... }"?<br></blockquote><div><br></div><div>No, onInit() needs to return.  If you need to do some kind of polling loop you need to start your own thread.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<br>
 * Is it OK that onInit() only returns when ros::ok() becomes false in<br>
that case?<br>
<br>
 * Does this loop need to call ros::spinOnce()? Even if it has no subscriptions?<br>
<br>
 * What happens if library classes used by both node and nodelet<br>
versions call ROS_INFO() or other ROS services? Are there things to<br>
avoid in those classes?<br></blockquote><div><br></div><div>This is fine.</div><div><br></div><div>Josh</div></div>