I read ROS Documentation:
publish() in roscpp is asynchronous, and only does work if there are subscribers connected on that topic. publish() itself is meant to be very fast, so it does as little work as possible:
- Serialize the message to a buffer
- Pushes that buffer onto a queue for later processing
The queue it's pushed onto is then serviced as soon as possible by one of roscpp's internal threads, where it gets put onto a queue for each connected subscriber -- this second set of queues are the ones whose size is set with the queue_size parameter in advertise(). If one of these queues fills up the oldest message will be dropped before adding the next message to the queue.
From the above I understand that the publisher pushes messages onto q1 and the subscriber retrieves data from q2. Data transfer from q1->q2 is taken care of by the roscpp internals. The documentation seems to suggest that advertise()'s queue_size option controls the size of q2 (not q1). Is that right? If that is really the case, then what controls the size of q1? And what queue does subscriber's queue_size control?
Originally posted by chukcha2 on ROS Answers with karma: 89 on 2016-09-06
Post score: 1