#[20] fix(turtlebot3-demo): add anomaly_detector for direct fault reporting#21
Merged
#[20] fix(turtlebot3-demo): add anomaly_detector for direct fault reporting#21
Conversation
- Add anomaly_detector.py that monitors navigation metrics and reports faults directly to FaultManager via /fault_manager/report_fault service - Monitors: navigation goal status (ABORTED/CANCELED), AMCL covariance, and robot progress - Remove inject-collision.sh and inject-controller-failure.sh as they produced redundant/unreliable faults - Simplify remaining inject scripts to rely on anomaly_detector - Update restore-normal.sh to remove lifecycle node reactivation - Add anomaly-detector to manifest (app + fault-management function) - Update README with new fault reporting architecture Fault codes: - NAVIGATION_GOAL_ABORTED: Navigation goal failed - NAVIGATION_GOAL_CANCELED: Navigation goal was canceled - LOCALIZATION_UNCERTAINTY: High AMCL covariance - NAVIGATION_NO_PROGRESS: Robot stuck during active goal
There was a problem hiding this comment.
Pull request overview
Adds a new anomaly_detector node to the TurtleBot3 integration demo to detect navigation/localization anomalies and report faults directly to FaultManager, while simplifying/removing legacy fault-injection scripts and updating documentation/manifest to reflect the new architecture.
Changes:
- Introduces
anomaly_detector.pyand launches it as part of the demo to report faults via/fault_manager/report_fault. - Simplifies fault injection scripts (and removes collision/controller injection scripts) to rely on anomaly detection rather than lifecycle manipulation.
- Updates demo manifest, packaging (CMake/Dockerfile), and README docs to include the anomaly detector and describe the new fault reporting paths.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| demos/turtlebot3_integration/stop-demo.sh | Ensures docker compose down targets both CPU and NVIDIA profiles. |
| demos/turtlebot3_integration/scripts/anomaly_detector.py | New ROS 2 node that monitors Nav2 status, AMCL covariance, and odom progress, and reports faults to FaultManager. |
| demos/turtlebot3_integration/restore-normal.sh | Adjusts restore messaging and output redirection; keeps parameter resets and fault clearing. |
| demos/turtlebot3_integration/launch/demo.launch.py | Launches the new anomaly detector node alongside existing demo components. |
| demos/turtlebot3_integration/inject-nav-failure.sh | Updates nav-failure injection to rely on anomaly detector; adds basic execution-status polling. |
| demos/turtlebot3_integration/inject-localization-failure.sh | Updates localization injection flow and expected faults to rely on anomaly detector. |
| demos/turtlebot3_integration/inject-controller-failure.sh | Removes controller-failure injection script. |
| demos/turtlebot3_integration/inject-collision.sh | Removes collision injection script. |
| demos/turtlebot3_integration/config/turtlebot3_manifest.yaml | Adds anomaly-detector app entry and includes it in fault-management function hosting. |
| demos/turtlebot3_integration/README.md | Documents the new direct fault reporting path and updates fault injection guidance. |
| demos/turtlebot3_integration/Dockerfile | Copies scripts/ into the ROS workspace so the anomaly detector is built/installed. |
| demos/turtlebot3_integration/CMakeLists.txt | Installs the anomaly detector script as an executable. |
| README.md | Adds repo badges (Docs/License/Discord). |
Comments suppressed due to low confidence (1)
demos/turtlebot3_integration/inject-nav-failure.sh:36
- The JSON body for creating a navigate_to_pose execution was changed from "request" to "goal". In this same demo, send-nav-goal.sh still uses "request", so at least one of these scripts will now be wrong. Please align the payload schema across scripts (and with the gateway’s operation schema) to avoid breaking injection.
RESPONSE=$(curl -s -X POST "${API_BASE}/apps/bt-navigator/operations/navigate_to_pose/executions" \
-H "Content-Type: application/json" \
-d '{
"goal": {
"pose": {
"header": {"frame_id": "map"},
"pose": {
"position": {"x": 100.0, "y": 100.0, "z": 0.0},
"orientation": {"w": 1.0}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mfaferek93
reviewed
Jan 31, 2026
- Fix covariance calculation (sqrt of sum, not sum of squares) - Fix has_active_goal race condition with multiple goals - Replace time.time() with ROS time for simulation compatibility - Fix docstring to match actual severity levels (ABORTED=ERROR, CANCELED=WARN) - Update launch comment to accurately describe fault reporting - Standardize navigation payload to use 'goal' instead of 'request' - Add execution_id fallback in inject-nav-failure.sh - Log KeyboardInterrupt on shutdown Addresses review comments from Copilot and mfaferek93.
mfaferek93
approved these changes
Feb 1, 2026
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.
Description
Fault codes:
Related Issue
closes #20
Checklist