-
Notifications
You must be signed in to change notification settings - Fork 1
#[20] fix(turtlebot3-demo): add anomaly_detector for direct fault reporting #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
- 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.
Description
Fault codes:
Related Issue
closes #20
Checklist