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

Trigger action according to diagnostics

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

Mackou gravatar image

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

Hello,

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
1

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

Question Tools

2 followers

Stats

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

Seen: 312 times

Last updated: Jun 18 '20