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

Polling overall diagnostics state

asked 2017-01-14 19:05:55 -0600

Cerin gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-01-14 21:44:55 -0600

ahendrix gravatar image

The /diagnostics_toplevel_state is the correct way to get a state summary from the diagnostic aggregator.

The level field indicates the state and is set from the OK, WARN, ERROR or STALE enum values defined in the DiagnosticStatus message.

In this case, level: 2 corresponds to ERROR.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2017-01-14 19:05:55 -0600

Seen: 285 times

Last updated: Jan 14 '17