Skip to content
Design System
GitHub

A robot's health from ROS DiagnosticArray: the worst level and counts first, then a tree by "/" path with levels rolled up, each status a glyph and a word, Stale, a Problems filter and search.

API reference

Generated from the types. Every part also takes className.

Diagnostics

statusesrequired
DiagnosticStatus[]Every status, as the latest of each name (merge arrays as they arrive with mergeDiagnostics from ros).
label
stringThe robot's name, written above and naming the panel for screen readers: "AMR-07".
loading
boolean = falseWaiting for the first diagnostics: a skeleton the size of a short tree.
staleAfterMs
number | null = 5000A status not updated for this long reads Stale (by its receivedAt). 5000 ms by default: diagnostic_updater publishes once a second, and ROS's own aggregator calls a status stale after 5 s. null never times out.
now
numberThe time to measure from, in ms since the epoch. Left out, the panel reads the browser's clock once a second while any status has a receivedAt. Pass it for a fixed picture (a test, a screenshot, a recorded bag played back).
filter
"all" | "problems"Which statuses the tree shows, controlled; pair with onFilterChange.
defaultFilter
"all" | "problems" = "all"The filter at first (uncontrolled).
onFilterChange
(filter: DiagnosticsFilter) => void
query
stringThe search text, controlled; pair with onQueryChange.
defaultQuery
string = ""The search text at first (uncontrolled).
onQueryChange
(query: string) => void
defaultExpanded
string[]Statuses and groups open at first, by name ("/Motors/Left wheel" opens that status's values, "/Motors" the group). Groups with a problem under them open by themselves; this is for anything else.
locale
stringBCP 47 tag for the numbers and the "ago" times ("zh-TW", "de"): pass the app's locale. Left out, English ("en") on the server and in every browser, so the page hydrates cleanly; a tag Intl cannot read falls back to "en".
labels
Partial<DiagnosticsLabels>