feat(log_bridge): add /rosout to faults bridge#422
Merged
Conversation
New ros2_medkit_log_bridge: subscribes /rosout and promotes WARN+/ERROR/ FATAL log entries to FaultManager faults, attributed to the originating node FQN so each fault associates with the runtime-discovered entity. Drop-in, no publisher code changes. Refs #420
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new ROS 2 package (ros2_medkit_log_bridge) that subscribes to /rosout and promotes WARN+/ERROR/FATAL log entries into medkit FaultManager faults, attributing each fault to the originating node and generating stable fault codes.
Changes:
- Introduces
LogBridgeNode(subscription, filtering, source_id normalization, fault_code generation) and a runnable executable + launch file. - Adds package configuration (
config/log_bridge.yaml) and end-user documentation (README.md,CHANGELOG.rst). - Adds GTest unit coverage for severity mapping, message normalization, fault_code stability, and source_id normalization.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ros2_medkit_log_bridge/test/test_log_bridge.cpp | Unit tests for mapping/normalization/fault code/source_id behavior |
| src/ros2_medkit_log_bridge/src/main.cpp | Entry point to spin the bridge node |
| src/ros2_medkit_log_bridge/src/log_bridge_node.cpp | Core bridge implementation: subscribe /rosout, filter, report faults |
| src/ros2_medkit_log_bridge/include/ros2_medkit_log_bridge/log_bridge_node.hpp | Public interface and documentation for LogBridgeNode |
| src/ros2_medkit_log_bridge/config/log_bridge.yaml | Default parameters for topic, severity floor, code prefix, filters |
| src/ros2_medkit_log_bridge/launch/log_bridge.launch.py | Launch description to run the node with the default config |
| src/ros2_medkit_log_bridge/CMakeLists.txt | Build targets + test setup |
| src/ros2_medkit_log_bridge/package.xml | Package metadata and dependencies |
| src/ros2_medkit_log_bridge/README.md | Usage docs and behavioral notes |
| src/ros2_medkit_log_bridge/CHANGELOG.rst | Package changelog entry |
5cf9a8b to
547c6bb
Compare
bburda
reviewed
Jun 16, 2026
bburda
left a comment
Collaborator
There was a problem hiding this comment.
Review findings inline (severity tagged per comment).
68fdeb1 to
ad45b97
Compare
Stable FNV-1a fault_code, uniform node_source_id, sanitized prefix, LRU-bounded reporters, null guard. Cooldown is now ERROR/FATAL-only and keyed by severity so a WARN cannot drop an ERROR escalation. Unique test domain range, docs-build wiring, and a launch_testing integration test for the live /rosout path.
ad45b97 to
9d9920a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ros2_medkit_log_bridge, a drop-in compatibility adapter (same category asros2_medkit_diagnostic_bridge) that subscribes to/rosoutand promotesWARN+/ERROR/FATALlog entries to FaultManager faults.FaultReporter, sosource_idis the node FQN and the fault associates with the runtime-discovered entity (snapshot/rosbag included).fault_codeis auto-generated and stable across occurrences (hash over a normalized message template: digits/hex/paths stripped).Native
ros2_medkit_fault_reporterinstrumentation stays the canonical path; this bridge is the fallback for nodes that only log.Unit tests cover level-to-severity mapping, fault_code generation/stability, and source_id normalization.
Closes #420