Is `diagnostics` the recommended system for monitoring sensor data rate?
Hi.
My goals are
- to find some way to easily monitor if a sensor driver node is publishing data at the expected rate, and
- to set up a general monitoring system for my ROS nodes, possibly tied to warning/error logging.
I've been looking into the diagnostics package and its sub-packages and tutorials. First of all, is diagnostics the recommended way to do what I'm trying to do? I was able to write a test node that publishes something and adds diagnostics for its own publishing rate, and it works, but it feels somewhat verbose for a "simple" task. Also, for third party drivers, it would be convenient to be able to add topic rate monitoring without modifying the publisher (to avoid maintaining a fork of the driver).
For more general monitoring, is it possible to monitor nodes based on whether they have ever printed warnings/errors/fatal errors to the log? So that all nodes with just info and debug to the log are "green", but if you ever print a warning, the node becomes "yellow" at least for a while, and so on.
Thanks.
Edit: A followup:
What about nodes that crash or otherwise fail to run their internal diagnostics? If a drive crashes, it won't for instance update its own topic frequency diagnostics, so on /diagnostics, I suppose the error won't show up. Is that right, and if so, what's the recommended way to solve it?