-
Notifications
You must be signed in to change notification settings - Fork 1
FaultManager configuration for snapshots (freeze frame and rosbag) #26
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
Enable automatic rosbag capture when faults are confirmed:
- Configure fault_manager with rosbag recording enabled
- Record 10 seconds before + 2 seconds after fault confirmation
- Use MCAP format for cross-platform compatibility
- Store recordings in persistent Docker volume
Configuration:
- medkit_params.yaml: Add fault_manager parameters with snapshot
and rosbag configuration
- docker-compose.yml: Add medkit_data volume for persistent storage
- launch/demo.launch.py: Pass medkit_params to fault_manager node
- Dockerfile: Create /var/lib/ros2_medkit/rosbags directory
Recorded topics include odometry, pose, scan, velocity commands,
transforms, navigation status/feedback, costmaps, and diagnostics.
Access rosbags via REST API:
GET /faults/{code}/bulk-data/rosbags
GET /faults/{code}/snapshots
Add fault_manager configuration to sensor_diagnostics demo with: - SQLite storage for fault persistence - Freeze-frame snapshot capture on fault confirmation - MCAP rosbag recording with ring buffer (10s pre + 2s post fault) - Sensor topics included: /sensors/scan, imu, fix, image_raw Infrastructure changes: - Pass medkit_params to fault_manager node in launch file - Create /var/lib/ros2_medkit/rosbags dir in Dockerfile - Add sqlite3 package to Dockerfile - Add persistent medkit_data volume to docker-compose - Add bulk-data/snapshot demo steps to check-demo.sh
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
This PR adds FaultManager configuration and Docker persistence to enable automatic snapshot + rosbag (MCAP) capture when faults are confirmed in the TurtleBot3 Integration and Sensor Diagnostics demos.
Changes:
- Pass
medkit_params.yamlintoros2_medkit_fault_managerlaunch nodes so FaultManager can be configured via YAML. - Add FaultManager storage + snapshot/rosbag settings to demo
medkit_params.yamlfiles (SQLite DB + MCAP rosbags). - Persist
/var/lib/ros2_medkitvia named Docker volumes and document the new rosbag/snapshot API usage.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| demos/turtlebot3_integration/launch/demo.launch.py | Loads medkit_params.yaml for FaultManager so it can use the new snapshot/rosbag configuration. |
| demos/turtlebot3_integration/docker-compose.yml | Adds a named volume to persist FaultManager DB and rosbags across runs. |
| demos/turtlebot3_integration/config/medkit_params.yaml | Adds FaultManager SQLite + snapshot/rosbag configuration (MCAP). |
| demos/turtlebot3_integration/README.md | Documents rosbag snapshot capture behavior and related API usage + volume persistence note. |
| demos/turtlebot3_integration/Dockerfile | Creates storage directory (but see PR comment about volume masking). |
| demos/sensor_diagnostics/launch/demo.launch.py | Loads medkit_params.yaml for FaultManager so it can use the new snapshot/rosbag configuration. |
| demos/sensor_diagnostics/docker-compose.yml | Adds a named volume to persist FaultManager DB and rosbags across runs. |
| demos/sensor_diagnostics/config/medkit_params.yaml | Adds FaultManager SQLite + snapshot/rosbag configuration (MCAP). |
| demos/sensor_diagnostics/check-demo.sh | Extends demo script to call snapshot/bulk-data endpoints when faults exist. |
| demos/sensor_diagnostics/Dockerfile | Installs sqlite3 and creates storage directory (but see PR comment about volume masking). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move mkdir from Dockerfile build to runtime (volume mount masks build-time dirs) - Remove --recurse-submodules from git clone (broken submodule ref) - Fix check-demo.sh: null-safe fault parsing, use entity-scoped API paths - Fix turtlebot3 README: use correct entity-scoped bulk-data endpoints - Add mkdir to all docker-compose commands for both demos
The mv command was missing destination directory '.' and '&&' separators between individual moves, causing 'mv: invalid option -- r' error because 'rm -rf ros2_medkit' was interpreted as mv arguments.
Volume mapping could cause issues when user has old faults in the fresh demo environment. Removing it to avoid confusion and potential issues with rosbag storage. Users can still access rosbag files through the container if needed.
Description
Adds FaultManager configuration and Docker persistence to enable automatic snapshot + rosbag (MCAP) capture when faults are confirmed in the TurtleBot3 Integration and Sensor Diagnostics demos.
Changes:
Related Issue
closes #25
Checklist