Skip to content

Conversation

@bburda
Copy link
Contributor

@bburda bburda commented Jan 31, 2026

Description

  • 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

Related Issue

closes #20

Checklist

  • Tested locally
  • README updated (if needed)

- 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
@bburda bburda requested a review from mfaferek93 January 31, 2026 17:10
@bburda bburda self-assigned this Jan 31, 2026
Copilot AI review requested due to automatic review settings January 31, 2026 17:10
@bburda bburda added the bug Something isn't working label Jan 31, 2026
Copy link

Copilot AI left a 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.py and 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.
@mfaferek93 mfaferek93 self-requested a review February 1, 2026 11:23
@bburda bburda merged commit e48d163 into main Feb 1, 2026
2 checks passed
@bburda bburda deleted the fix/fault-injection branch February 1, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fault injection not working

3 participants