-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rospy: queue_size documentation #507
Comments
Questions that could be address in wiki:
I would document all this myself, but am not confident enough in my knowledge |
1) There are simply so many wiki pages that we can not touch them all. The wiki is a community effort - please feel free to update any wiki page you find. But keep in mind that those should still work with Groovy and older ROS distros (if they don't contain separate tabs for each ROS distro). 2) Please read the wiki page you referenced - it clearly answers your question under 3) Imo there is no "good rule of thumb". If your system is not overloaded you could argue that a queued message should be picked up by the dispatcher thread within a tenth of a second. So a queue size of 1 / 2 / 3 would be absolutely fine when using 10 Hz. But some nodes e.g. publish multiple messages directly after each other - in this case a queue size of 1 would lead to dropping all previous messages but the last one. Generally speaking using a bigger queue_size will only use more memory when you are actually behind with the processing - so I would recommend to pick a value which is bigger then it needs to be rather then a too small value. 4) Setting the queue_size to 1 is a valid approach if you want to make sure that a new published value will always prevent any older not yet sent values to be dropped. (Assuming that you do not want to record all published values including the dropped ones.) |
The aspect I think is missing/most unclear to me is how the For example, the documentation uses the example of a subscriber with a bad connection blocking everyone else in the old synchronous publishing scheme; when that is switched to an asynchronous scheme with a finite queue_size > 1 (e.g. 10), what happens to the available queue #'s / 'slots', if one of the subscribers gets held up on a given message... Does it dedicate one thread to each subscriber, so therefore the other subscribers continue to get message 1, message 2, message 3, etc. while the blocked subscriber sits and waits on message 1? Is each subscriber designated its own thread? Will the backlog of messages waiting to go out to the bad subscriber start filling up the other queue slots? I'm not sure if this is how it ACTUALLY works, but one way I could understand it working is queues are really just about subscribers, not messages, and bad subscribers only take up one queue slot, no matter how many messages come in. IF this is accurate, it would mean the queue_size variable would essentially be "how many blocked subscriber-connections before your publisher is completely blocked" |
The queue size defines the size of the queue aka the maximum number of messages to buffer. Each subscriber has his own queue and dispatching thread in order to achieve asynchronous publishing which does never block other subscribers if one is blocked. |
@dirk-thomas I appologize if I sounded acusational or agressive - I know OSRF resources are limited and ROS is a community effort. I've contributed to many wiki pages and am always looking to improve them, which is why I am posting here. I infact have edited this rospy page before and read it again before posting this issue.
I've used ROS for several years now without ever having to think about this, and I've never had an issue, so there must be something users can use quickly without having to worry about it. Previously, that was None I'll attempt to take all this information now and update the wiki, please feel free to review. |
This is still a little unclear - if |
I just added a detailed section titled |
Thank you for improving the docs with the detailed guidelines. Synchronous publishing does not require a queue. Every published message will be sent to every subscriber in a blocking fashion. Asynchronous publishing does require a queue to store the messages until they have been dispatched to all subscribers. So I don't there is any mixed purpose here. |
Now I understand, thanks! |
Moved from RethinkRobotics/baxter_interface#38 (comment)
davetcoleman:
dirk-thomas:
The text was updated successfully, but these errors were encountered: