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

Current pub/sub queue length

asked 2015-01-07 05:36:17 -0600

madmage gravatar image

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).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-08 00:33:37 -0600

ahendrix gravatar image

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.

edit flag offensive delete link more

Question Tools


Asked: 2015-01-07 05:36:17 -0600

Seen: 1,481 times

Last updated: Jan 08 '15