From 00df1fc76621e5b9b9c77ffee60265595d15f35c Mon Sep 17 00:00:00 2001 From: David Tarazi Date: Fri, 20 Nov 2026 12:53:57 -0800 Subject: [PATCH 1/2] adding a debug level to faults as a wrapper so filtering can be done better --- CMakeLists.txt | 1 + msg/ActiveFault.msg | 11 +++++++++++ msg/SubsystemHealth.msg | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 msg/ActiveFault.msg diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cc40cf..b808f75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ set(dependencies rosidl_generate_interfaces(${PROJECT_NAME} # Messages + "msg/ActiveFault.msg" "msg/Capability.msg" "msg/CapabilityDescriptor.msg" "msg/CapabilityFeedback.msg" diff --git a/msg/ActiveFault.msg b/msg/ActiveFault.msg new file mode 100644 index 0000000..d533a4f --- /dev/null +++ b/msg/ActiveFault.msg @@ -0,0 +1,11 @@ +# One active fault in a subsystem: the fault manager's fault verbatim, plus what +# Polymath derives from its fault_code. + +ros2_medkit_msgs/Fault fault + +# True for a deeper-level debug fault: its code starts with DEBUG_ after the +# category (e.g. SENSORS_DEBUG_GPS_RAW) and its severity is below ERROR. An ERROR or +# CRITICAL fault is never flagged, whatever its code. It only labels the fault, +# for filtering detailed faults from high-level ones; it does not change any severity, +# count or summary text. +bool debug diff --git a/msg/SubsystemHealth.msg b/msg/SubsystemHealth.msg index 24ae8f7..5fb1803 100644 --- a/msg/SubsystemHealth.msg +++ b/msg/SubsystemHealth.msg @@ -8,5 +8,5 @@ string name # Severity of the worst active fault (ros2_medkit_msgs/msg/Fault SEVERITY_* values). uint8 severity -# Individual active faults (verbatim from the fault manager), worst-first then by fault_code. -ros2_medkit_msgs/Fault[] faults +# Individual active faults, worst-first then by fault_code. +ActiveFault[] faults From d94f58603b9428603e9db4930edb160eb136559e Mon Sep 17 00:00:00 2001 From: David Tarazi Date: Tue, 24 Nov 2026 11:43:34 -0800 Subject: [PATCH 2/2] change to report level instead of bool in case of needing more levels --- msg/ActiveFault.msg | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/msg/ActiveFault.msg b/msg/ActiveFault.msg index d533a4f..845ff0c 100644 --- a/msg/ActiveFault.msg +++ b/msg/ActiveFault.msg @@ -3,9 +3,13 @@ ros2_medkit_msgs/Fault fault -# True for a deeper-level debug fault: its code starts with DEBUG_ after the -# category (e.g. SENSORS_DEBUG_GPS_RAW) and its severity is below ERROR. An ERROR or -# CRITICAL fault is never flagged, whatever its code. It only labels the fault, -# for filtering detailed faults from high-level ones; it does not change any severity, -# count or summary text. -bool debug +# How much detail a report must ask for to include this fault. It only labels the +# fault, for filtering detailed faults from high-level ones; it does not change any +# severity, count or summary text. +# ALL: part of every report, high-level or detailed. This is the default. +# DEBUG: a deeper-level fault, for detailed reports only. Its code starts with DEBUG_ +# after the category (e.g. SENSORS_DEBUG_GPS_RAW) and its severity is below ERROR. An +# ERROR or CRITICAL fault is always ALL, whatever its code. +uint8 REPORT_LEVEL_ALL = 0 +uint8 REPORT_LEVEL_DEBUG = 1 +uint8 report_level 0