[ros-users] Nodelets

Nicholas Butko nbutko at ucsd.edu
Sat Dec 4 23:24:22 UTC 2010


On Dec 3, 2010, at 6:36 PM, Radu Bogdan Rusu wrote:

> 
> On 12/02/2010 01:54 PM, Patrick Bouffard wrote:
>> Cool. One way to go would be a tutorial on how to transform a node
>> into a nodelet. It seems to be a fairly simple recipe, modulo the
>> blocking and threading stuff:
>> - add the necessary #includes
>> - get rid of int main()
>> - subclass nodelet::Nodelet
>> - move code from constructor to onInit()
>> - add the PLUGINLIB_DECLARE_CLASS macro
>> - add the<nodelet>  item in the<export>  part of the package manifest
>> - create the .xml file to define the nodelet as a plugin
>> - make the necessary changes to CMakeLists.txt (comment out a
>> rosbuild_add_executable, add a rosbuild_add_library)
> 
> Great, I added this as a starting point to http://www.ros.org/wiki/nodelet/Tutorials/Porting%20nodes%20to%20nodelets . 
> Can we all please fill in the page when we get a chance with more content?

Is there a nodelet equivalent of a "while (ros::ok()) {}" loop? 

I am trying to move some computer vision code to nodelets. The idea is to have one camera nodelet serving frames, and everybody else grabbing and processing them. 

From the "nodelet" examples, it looks like all work is typically done in onInit() and in subscriber callbacks. So, to implement a camera server, I'd either have to never finish initializing (is this okay?) or to set up an extra node that sends "wakeup" messages every 30 ms or so, and grab frames in the callback. 

Is there a way to set up a "callMeEvery30MS" callback function in a nodelet? Or even a "callAndLetMeRunForeverWhileOtherThreadsDoTheirThing()" callback function that could then run an infinite loop?

--Nick 


More information about the ros-users mailing list