Ask Your Question

rospy.Publisher: what's a good choice for queue_size?

asked 2014-08-15 16:15:34 -0600

Rick Armstrong gravatar image


We just switched over to using Indigo, and noticed the warnings about using rospy.Publisher without specifying a queue_size. I've read this and I can see that it's a fabulous idea to specify this value. What's a good value to use, and how do I know if I've picked a reasonable number?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-16 23:00:48 -0600

tfoote gravatar image

The queue size is a balance between latency and completeness. If your usage only wants the latest data a small queue size is appropriate. If your application would rather have more complete information a larger queue size is preferred.

Note it will only be an issue if your topic backs up. Another consideration is if the publisher will be pushing multiple messages close together make sure the queue is big enough to hold the whole batch if you don't want losses.

edit flag offensive delete link more


Thanks Tully,


Rick Armstrong gravatar imageRick Armstrong ( 2014-08-17 15:20:13 -0600 )edit

Are there any performance or efficiency concerns connected to the queue size? I.e. does a smaller queue size save memory or is there no gain of a small queue size over a large queue size?

Paddre gravatar imagePaddre ( 2017-07-22 05:17:56 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-08-15 16:15:34 -0600

Seen: 3,381 times

Last updated: Aug 16 '14