Can subscribers emit a "receipt" upon reception of a message?

asked 2020-10-30 15:30:04 -0500

olamarre gravatar image

updated 2020-11-02 12:46:55 -0500

Hi! Is it possible for generic subscriber objects to emit a "receipt" upon reception of a message (ex: publish an empty or lightweight confirmation message)?

This would be a useful feature for pipeline health monitoring & bagging. For example, instead of bagging all messages exchanged between nodes (some of which can be pretty heavy like mapping or point cloud topics), bagging a simple message receipt topic would be more convenient. I am using ROS melodic on Ubuntu 18.04.

Alternatively, does an already-existing feature already provide something similar?

Thanks!

EDIT #1: A few clarifications

I indeed assume that bagging all the topics is a way to estimate how well the system was doing (I do a lot of field experiments, and usually analyze the bagged data offline to investigate faults, etc.). All input and output data coming in and out of the navigation pipeline is bagged (ex: raw imagery and navigation commands), but other intermediate topics like point clouds, maps, etc. are too heavy to be bagged.

When the navigation pipeline stops outputting anything, a first check to narrow down the source of the problem is to find which node stopped publishing. Online, we can simply rostopic echo / hz several topics until we find the node at fault. Offline, this is unfortunately not possible if not all topics are bagged.

I was therefore wondering if it was possible for subscribers to publish a "ping" (or "receipt") when their callback function was called. This behavior could be enabled by passing a boolean argument to the subscriber constructor.

I believe an equivalent capability would be the ability to bag only a sub-attribute of a topic (for example, rosbag record /my_heavy_topic/header instead of the usual rosbag record /my_heavy_topic). This way, when using visual bag inspection tools like rqt_bag, we could easily see when messages were published across the pipeline without having to bag all the (heavy) data they carry.

edit retag flag offensive close merge delete

Comments

I'd say that a service does that. If you just want a subscriber to publish a message, you can just add a publisher. But there is no built-in functionality that does that. (Also, should a subscriber to the receipt message again also publish a receipt message and who should subscribe to that?)

mgruhler gravatar image mgruhler  ( 2020-11-02 02:47:11 -0500 )edit

I was going to ask @olamarre for a bit more detail on why he asks this question (xy-problem), but the duplicate of his post appears to contain this. As I've deleted the duplicate, I'm copying it here in a comment:

This would be a useful feature since it would provide insights about the health of a system without having to bag all messages exchanged between nodes, which can be pretty large (ex: map or point cloud messages). I am using ROS melodic on Ubuntu 18.04.

So the motivation appears to be "monitoring the health of a system".

@olamarre: what would you consider to be a healthy system? And how are the read receipts you mention intended to be used?

The quote I copied from your duplicate question implies you see subscribing to all available topics as a way of determining system health. Is that correct?

gvdhoorn gravatar image gvdhoorn  ( 2020-11-02 03:52:36 -0500 )edit

Thanks @mgruhler and @gvdhoorn! I edited my question above and clarified what I meant.

olamarre gravatar image olamarre  ( 2020-11-02 12:42:41 -0500 )edit