Skip to content

Commit e383cc7

Browse files
committed
fix(#80): update all documentation for debounce model
- Update FaultEvent.msg comment (PENDING → PREFAILED) - Update ros2_medkit_msgs README FaultEvent table - Update design/index.rst with debounce lifecycle model - Update service descriptions for event_type and accepted response
1 parent 993b96c commit e383cc7

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

src/ros2_medkit_fault_manager/design/index.rst

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Main Components
131131
- Maps directly to ``ros2_medkit_msgs::msg::Fault`` via ``to_msg()``
132132
- Uses ``std::set`` for reporting_sources to ensure uniqueness
133133
- Tracks first and last occurrence timestamps
134-
- Manages fault status lifecycle (PENDING → CONFIRMED → CLEARED)
134+
- Manages fault status lifecycle with debounce (PREFAILED → CONFIRMED → CLEARED)
135135

136136
Services
137137
--------
@@ -141,17 +141,19 @@ Services
141141

142142
Reports a new fault or updates an existing one.
143143

144-
- **Input validation**: fault_code and source_id cannot be empty, severity must be 0-3
144+
- **Input validation**: fault_code and source_id cannot be empty, event_type must be valid
145+
- **Event types**: FAILED (fault detected) or PASSED (fault condition cleared)
146+
- **Debounce**: FAILED events decrement counter, PASSED events increment counter
145147
- **Aggregation**: Same fault_code from different sources creates a single fault entry
146148
- **Severity escalation**: Fault severity is updated if a higher severity is reported
147-
- **Returns**: ``success=true`` with message indicating "New fault" or "Fault updated"
149+
- **Returns**: ``accepted=true`` if event was processed
148150

149151
~/get_faults
150152
~~~~~~~~~~~~
151153

152154
Queries faults with optional filtering.
153155

154-
- **Status filter**: Filter by status (PENDING, CONFIRMED, CLEARED); defaults to CONFIRMED
156+
- **Status filter**: Filter by status (PREFAILED, PREPASSED, CONFIRMED, HEALED, CLEARED); defaults to CONFIRMED
155157
- **Severity filter**: When ``filter_by_severity=true``, returns only faults of specified severity
156158
- **Returns**: List of ``Fault`` messages matching the filter criteria
157159

@@ -191,14 +193,17 @@ When a fault is re-reported with a higher severity, the stored severity is updat
191193
This ensures the fault reflects the worst-case condition. Severity levels are ordered:
192194
``INFO(0) < WARN(1) < ERROR(2) < CRITICAL(3)``.
193195

194-
Status Lifecycle
195-
~~~~~~~~~~~~~~~~
196+
Status Lifecycle (Debounce Model)
197+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
196198

197-
Faults follow a lifecycle: PENDING → CONFIRMED → CLEARED
199+
Faults follow an AUTOSAR DEM-style debounce lifecycle:
198200

199-
- **PENDING**: Initial status when fault is first reported
200-
- **CONFIRMED**: Status after automatic or manual confirmation (Issue #6)
201-
- **CLEARED**: Status after fault is cleared/acknowledged
201+
- **PREFAILED**: Debounce counter < 0 but above confirmation threshold (fault trending towards confirmation)
202+
- **PREPASSED**: Debounce counter > 0 but below healing threshold (fault trending towards healing)
203+
- **CONFIRMED**: Debounce counter <= confirmation threshold (e.g., -3). Fault is active and verified.
204+
- **HEALED**: Debounce counter >= healing threshold (if healing enabled). Fault resolved by PASSED events.
205+
- **CLEARED**: Fault manually acknowledged via ClearFault service
202206

203-
Currently, faults start as PENDING and move to CLEARED when explicitly cleared.
204-
Automatic PENDING → CONFIRMED transitions will be implemented in Issue #6.
207+
FAILED events decrement the debounce counter (towards confirmation).
208+
PASSED events increment the debounce counter (towards healing).
209+
CRITICAL severity bypasses debounce and confirms immediately.

src/ros2_medkit_msgs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Real-time fault event notification for SSE streaming (published on `/fault_manag
6767
**Event Types:**
6868
| Constant | Trigger |
6969
|----------|---------|
70-
| `EVENT_CONFIRMED` | Fault transitions PENDING → CONFIRMED |
70+
| `EVENT_CONFIRMED` | Fault transitions PREFAILED → CONFIRMED |
7171
| `EVENT_CLEARED` | Fault transitions to CLEARED |
7272
| `EVENT_UPDATED` | Fault data changes without status transition |
7373

src/ros2_medkit_msgs/msg/FaultEvent.msg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Fault fault
2727
builtin_interfaces/Time timestamp
2828

2929
# Event type constants
30-
# Emitted when a fault transitions from PENDING to CONFIRMED status
31-
# (e.g., after reaching confirmation threshold of N reports within time window).
30+
# Emitted when a fault transitions from PREFAILED to CONFIRMED status
31+
# (e.g., after debounce counter reaches confirmation threshold).
3232
string EVENT_CONFIRMED = "fault_confirmed"
3333
# Emitted when a fault transitions to CLEARED status via ClearFault service.
3434
string EVENT_CLEARED = "fault_cleared"

0 commit comments

Comments
 (0)