Polling overall diagnostics state
How do you find the overall diagnostics state from the diagnostics aggregator?
My diagnostics are running and viewable in RQT monitor, and now I'd like to make a simple rospy node that sets a status LED to red if there's an error, and green otherwise.
From the docs, I see there's a /diagnostics_toplevel_state
topic, which I intuit should contain this info, but when I echo it, all I see is:
level: 2
name: toplevel_state
message: ''
hardware_id: ''
values: []
do all blank values mean everything is ok, or am I misinterpreting this? Is there a better way to poll the diagnostics aggregator?