One Global callbackqueue for each node?
From what I know:
1) If we do not specify, by default the subscribe is going to global callbackqueue on that node.
2) I assume that each node has 1 global callbackqueue
3) However I read question&ans from answer.ros.org (I lost the link already)--->if we have mulitple subscribers for a node, let's say subA and subB in the same node1. We can assign different queueSize for each :
ros::Subscriber sub1A = n.subscribe("topicA", 1, callbackMon);
ros::Subscriber sub1B = n.subscribe("topicB", 1000, callbackMon);
I tried to implement this, and yes it's true. But I don't know why.
I want explanation on this. I thought by default sub1A and sub1B are assigned to the SAME global callbackqueue (see my point 2) , so how come I can assign different sizes for the SAME queue?
To support my question, from callback and spinning overview , I read that the implementation for spinOnce is basically :
ros::getGlobalCallbackQueue()->callAvailable(ros::WallDuration(0));
So I see that spinOnce only call from ONE QUEUE, that is the globalcallbackqueue, so I can't see that this only queue can be assign to different sizes?
------------------------------------------------------------EDIT--------------------------------------------------------------------
Please confirm/correct the following statements:
When we do n.subscribe, the queue size refers to incoming message queue
Each subscriber has one incoming message queue
When we do advertise, the queue size refers to outgoing message queue
Each publisher has one outgoing message queue
Each node (by default) has one global callback queue.
Questions:
What about the callback queue size? Where do we set it?What is its default size? What happen if the incoming message queue size is small that the message has been thrown away but the callback for handling that message still in the callback queue?