-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the /diagnostics_toplevel_state ERROR when one of the diagnostics is STALE #297
Comments
Hi @Rayman and thank you for your comment. I agree with you that this makes more sense but, as you stated, this is a breaking change so for Noetic I do not believe it can be merged as is. I am not sure how the ros2 maintainers would see this change for the ros2 version... |
Hi @Rayman. Thanks for your suggestion. Just to be clear: The stale state is set by the generic analyzer if no message was received within a given timeout: diagnostics/diagnostic_aggregator/include/diagnostic_aggregator/generic_analyzer_base.hpp Line 196 in a80bd1c
Which can be useful information on the actuality of a state. If I get it correctly, your suggestion is to treat it in aggregation like the other levels and aggregate it in the group. There, I would honestly have a hard time to rate it in severity between the other levels. Currently, it is level 3 which reads as the highest priority. This means you would only see stale on the highest level, even if another item in that group is in the error state. This can not be the intended behavior. Changing these levels would be a SERIOUS breaking change. What is your take on that? |
The toplevel state is not just the maximum of all the levels. Its calculated with the following algorithm if maximum_level > ERROR and minimum_level <= ERROR
# one or more STALE, but not all of them
level = ERROR
else:
level = maximum_level I would propose to change this to the following, because I think it's more logical. if maximum_level == STALE and maximum_level_without_stale < ERROR
# one or more STALE, but no errors
level = STALE
else:
level = maximum_level_without_stale This will be the difference between the two algorithms:
|
What I find counter-intuitive about the current behavior is that if you have three leaf diagnostics rolled up into a group, the diagnostics_aggregator:
ros__parameters:
pub_rate: 1.0
path: 'robot'
analyzers:
part:
type: 'diagnostic_aggregator/AnalyzerGroup'
path: 'part'
foo:
type: 'diagnostic_aggregator/GenericAnalyzer'
path: 'foo'
find_and_remove_prefix: ['/foo:']
num_items: 1
bar:
type: 'diagnostic_aggregator/GenericAnalyzer'
path: 'bar'
find_and_remove_prefix: ['/foo:']
discard_stale: true
baz:
type: 'diagnostic_aggregator/GenericAnalyzer'
path: 'baz'
find_and_remove_prefix: ['/baz:']
discard_stale: true |
I did not want to propose to merge a breaking change in noetic, so I've implemented my proposed change in our fork: https://github.com/nobleo/diagnostics. Feel free to use it I've implemented the change for the toplevel diagnostics and for the |
I also added my implementation here: #315 |
Since this was a breaking change for Noetic, it probably also is for Humble and Iron? Does it make sense to put some effort into this before ROS Jazzy? |
In the current code the toplevel state is only STALE when ALL the diagnostics are STALE. Example:
What I think is more logical is that the state is STALE when one of the diagnostics is STALE and none of them ERROR:
What do you think about this logic? I've implemented this in my fork, but it is a breaking change
The text was updated successfully, but these errors were encountered: