Skip to content

diagnostic_aggregator: honour publisher-marked persistent statuses - #680

Open
fujitatomoya wants to merge 2 commits into
ros:ros2from
fujitatomoya:feat/679-persistent-state
Open

fujitatomoya wants to merge 2 commits into
ros:ros2from
fujitatomoya:feat/679-persistent-state

Conversation

@fujitatomoya

Copy link
Copy Markdown

Analyzers decide staleness purely from the age of the last message. A status
that stops being updated is rewritten to STALE, or dropped when discard_stale
is set, and OtherAnalyzer drops it after 5 s. The publisher had no way to say
"this is my final, intentional state, keep it".

Introduce the reserved key-value "persistent_state: True" in
DiagnosticStatus.values. StatusItem parses it on every update, and
GenericAnalyzerBase skips the stale and discard handling for such items, so
they keep their last level and message. A "last_update_age" value is appended
to persistent items only, so output for everything else is unchanged.
Publishing the status again without the key restores the normal behaviour.

GenericAnalyzer gains an optional persistent_timeout parameter (default
unlimited) to cap how long a persistent item is honoured.

DiagnosticStatusWrapper gets setPersistentState() in C++ and Python as a
typo-safe way to set the key.

Add a launch test covering GenericAnalyzer, OtherAnalyzer, discard_stale,
persistent_timeout and the reset path, and document the feature and its
limits (meant for terminal/latched states, not kept across aggregator
restarts).

Fixes #679

Signed-off-by: Tomoya Fujita <fujita.tomoya@triorb.co.jp>
- Accept integer-typed values for persistent_timeout. A YAML value such
  as "persistent_timeout: 3600" is typed INTEGER by rclcpp and as_double()
  would throw and kill the aggregator at startup.
- Add an aggregator-level other_persistent_timeout parameter (default
  unlimited) and forward it to OtherAnalyzer, which otherwise hard-codes
  its init() arguments and had no way to cap persistent items.
- Document both in the README and header comments, and extend the launch
  test with an Other-analyzer cap case; two cases now use integer timeout
  values on purpose.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Tomoya Fujita <fujita.tomoya@triorb.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diagnostic_aggregator: let publishers mark a status as persistent so it is not turned STALE or discarded by the timeout

1 participant