0
$\begingroup$

Rosanswers logo

Dear all, what if I would like to know how many objects are currently in the publisher's queue or in one of the subscribers' queue? I would like to monitor if they gets too long (and, e.g., some message starts to be thrown away).


Originally posted by madmage on ROS Answers with karma: 293 on 2015-01-07

Post score: 3

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I'm not aware of a way to query the queue size in rospy or roscpp.

This is made more complicated by the fact that queues are maintained on a per-connection basis, rather than a per-topic basis, so each publisher may have multiple queues, and each subscriber may have multiple queues.

The sequence number from a particular publisher should increase by 1 for every message, so that's a start towards determining if messages have been dropped, but if there are two publishers on a topic, each will have its own series of sequence numbers, and if a publisher is restarted, the sequence will probably restart from 0. You could probably use the meta-info about a message to determine which publisher a message came from, and track the sequence numbers for each publisher separately.


Originally posted by ahendrix with karma: 47576 on 2015-01-08

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.