I have been using ROS for a short time now and learned about callbacks & spinning. My question is, since be default all callbacks are added to the global callback queue, does ros::spin() in node A also process callbacks for subscribers in node B?
For a specific example, in MAVROS there is a 4 thread asynchronous spinner. I built a ROS node that uses MAVROS. In my node I also use an asynchronous spinner to process callbacks; however if they both use the global callback queue then is my asynchronous spinner redundant?
Thanks!
Originally posted by powerstorm42 on ROS Answers with karma: 11 on 2016-06-21
Post score: 0
Original comments
Comment by billy on 2016-06-21:
I can't comment on your specific use of MAVROS in your node, but in general, a spin in one node will not cause a callback to process in a different node. I know that from personal experience so have no cite for you. It's easy to check. Remove and see what happens.
Comment by Martin Günther on 2016-06-23:
The term "global callback queue" means "global" within the context of the node process, not between different processes. You can either create an asynchronous spinner, call spin() or call spinOnce().
Comment by powerstorm42 on 2016-06-23:
Thanks everyone! I understand it know, especially Martin's explanation that the queue is only global within the node, not across all nodes.