Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multiple Nodehandles will not give you multiple callback queues. Nodehandles are just "handles" to a global singleton that manages the ROS publish/subscribe interface. For what you're trying to do, you should check out this article on the ROS wiki:, specifically the section called Advanced: Using Different Callback Queues.

In this situation, I usually use a "thin" callback that just pushes the message onto a work queue and a standard producer/consumer threading model to do the long-running work. If your callback uses the message pointer signature and your work queue is also just a queue of shared pointers, you can push the message to the work queue without copying any data.