ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

roscpp: requesting current queue state of subscriber

asked 2015-04-09 01:45:46 -0500

Wolf gravatar image

I have a node, where I would like a subscriber to have a high queue size during initialization of some internal processors (during which my node intentionally lacks calling into ros spinner) to avoid loss of messages in this time but (safely) low queue size when the processor is active, to keep the responsiveness of the processor high.

Is it possible to change the queue size of a subscriber on the fly? Also, can I check how many messages are currently in the queue of a subscriber? I have not found any info on that in the API docu, but maybe someone has an undocumented workaround?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-09 12:18:03 -0500

Dirk Thomas gravatar image

Changing the queue size dynamically is currently not supported.

None of the information about the current message count in the subscription queue is publically accessible.

If you want to trace the hierarchy: When you subscribe on a NodeHandle a Subscription is added to the TopicManager. The subscription will then contain the SubscriptionQueue which has the information about the received messages. But most of the members along the line you would be interested in are private.

edit flag offensive delete link more

Comments

Ok, thank you for this information. I think will then stick to an own queue after the callback that I can dynamically resize and set down the subscriber queue to something low.....

Wolf gravatar image Wolf  ( 2015-04-09 12:24:04 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-04-09 01:45:46 -0500

Seen: 641 times

Last updated: Apr 09 '15