ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Briefly, yes, you're missing something. :)
More expansively, a node is a process; separate nodes execute independently. In your case, you have at least two nodes, one with a subscriber member (call it subNode) and (at least) one other node with a publisher member (call it pubNode). SubNode executes by endlessly looping -- during each loop, the 'spinOnce' checks the callback queue for messages. Unless and until pubNode publishes a message that subNode receives, nothing will happen (beyond the endless looping).
In general, there's no guarantee which message subNode will receive first, but it will handle its callbacks in the order it receives the messages.
2 | No.2 Revision |
Briefly, yes, you're missing something. :)
More expansively, a node is a process; separate nodes execute independently. In your case, you have at least two nodes, one with a two subscriber member members (call it subNode) and (at least) one other node with a publisher member member(s) (call it pubNode). SubNode executes by endlessly looping -- during each loop, the 'spinOnce' checks the callback queue for messages. Unless and until pubNode publishes a message that subNode receives, nothing will happen (beyond the endless looping).
In general, there's no guarantee which message subNode will receive first, but it will handle its callbacks in the order it receives the messages.