I wrote one recently. A separate Convert
class does the work, and a minimal node and nodelet instantiate it. For several reasons, I find it convenient to have both.
Originally posted by joq with karma: 25443 on 2012-04-08
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Alekzander on 2012-04-08:
Thanks a lot that's very illustrative, just one more question, the onInit method is kind of the same as: int main()?
Comment by tfoote on 2012-04-09:
It is not like main. It should return quickly. It will be called when the nodelet has been created to allow you to setup operations.
Comment by joq on 2012-04-09:
@tfoote makes an important point. Don't think of onInit() as main(), it's really just the constructor, which should return immediately.