Ask Your Question

Trigger action according to diagnostics

asked 2020-06-17 19:12:12 -0500

Mackou gravatar image

updated 2020-06-17 19:15:30 -0500


I have nodes publishing diagnostic data and I have configured them correctly and I can visualize them in Rviz.

But now I would like to trigger some actions, for example ring a buzzer when one sensor fails.

Do I need to create my own diagnostic analyzer that will do what I need ? Or do I need to write a node that will subscrive to /diagnostics_agg or /diagnostics_toplevel_state ?

Thanks a lot ! :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-18 00:30:08 -0500

fergs gravatar image

Diagnostics were really originally designed for human readable outputs. The diagnostics_aggregator really exists to clean up diagnostics and re-arrange them for human viewing - the aggregator uses Analyzers (there is a tutorial on creating custom analyzers).

The messages are generally not ideal for machine processing (while there are warning levels, most of the information tends to be string-based) - but you could certainly do that. You would almost certainly have to write your own node which could subscribe to either of the aggregated or non-aggregated diagnostics topics.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-06-17 19:12:12 -0500

Seen: 64 times

Last updated: Jun 18 '20