ReportFault
This is a ROS service definition.
Source
# Copyright 2025 mfaferek93
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ReportFault.srv - Report a fault event to the FaultManager.
#
# Called by FaultReporter clients or directly by nodes to report fault conditions.
# The FaultManager aggregates reports by fault_code across all sources and applies
# debounce filtering based on FAILED/PASSED event counts.
# Request fields
# Global fault identifier. Convention: UPPER_SNAKE_CASE (e.g., "MOTOR_OVERHEAT").
# Recommended max length: 64 characters. Allowed: A-Z, 0-9, underscore.
# Same fault_code from different sources = single aggregated fault.
string fault_code
# Event type indicating whether the fault condition is detected or cleared.
# FAILED: Fault condition detected - decrements internal debounce counter.
# PASSED: Fault condition cleared - increments internal debounce counter.
# Use EVENT_* constants for type safety.
uint8 event_type
# Event type constants
uint8 EVENT_FAILED = 0
uint8 EVENT_PASSED = 1
# Severity level: 0=INFO, 1=WARN, 2=ERROR, 3=CRITICAL.
# Use Fault.SEVERITY_* constants for type safety.
# Only meaningful for FAILED events; ignored for PASSED events.
# CRITICAL severity bypasses debounce filtering and confirms immediately.
uint8 severity
# Human-readable description of the fault condition.
# Only updated for FAILED events. PASSED events retain the existing description.
string description
# Identifier of the reporting node/entity. Recommended: fully qualified ROS 2 node name
# including namespace (e.g., "/powertrain/engine/temp_sensor").
# This value is added to the fault's reporting_sources array for multi-source tracking.
string source_id
---
# Response fields
# True if the event was accepted (valid input). False only for validation errors
# (e.g., empty fault_code, invalid event_type, invalid severity for FAILED events).
bool accepted