Skip to content

FaultManager configuration for snapshots (freeze frame and rosbag)#26

Merged
bburda merged 6 commits intomainfrom
feat/rosbag-generation
Feb 8, 2026
Merged

FaultManager configuration for snapshots (freeze frame and rosbag)#26
bburda merged 6 commits intomainfrom
feat/rosbag-generation

Conversation

@bburda
Copy link
Contributor

@bburda bburda commented Feb 5, 2026

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:

  • Pass medkit_params.yaml into ros2_medkit_fault_manager launch nodes so FaultManager can be configured via YAML.
  • Add FaultManager storage + snapshot/rosbag settings to demo medkit_params.yaml files (SQLite DB + MCAP rosbags).
  • Persist /var/lib/ros2_medkit via named Docker volumes and document the new rosbag/snapshot API usage.

Related Issue

closes #25

Checklist

  • Tested locally
  • README updated (if needed)

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
@bburda bburda self-assigned this Feb 5, 2026
@bburda bburda added the enhancement New feature or request label Feb 5, 2026
@bburda bburda marked this pull request as ready for review February 6, 2026 16:10
Copilot AI review requested due to automatic review settings February 6, 2026 16:10
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

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.yaml into ros2_medkit_fault_manager launch nodes so FaultManager can be configured via YAML.
  • Add FaultManager storage + snapshot/rosbag settings to demo medkit_params.yaml files (SQLite DB + MCAP rosbags).
  • Persist /var/lib/ros2_medkit via 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.

@bburda bburda changed the title Feat/rosbag generation FaultManager configuration for snapshots (freeze frame and rosbag) Feb 6, 2026
- 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
@bburda bburda requested a review from mfaferek93 February 6, 2026 17:20
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.
@bburda bburda merged commit 6837a3a into main Feb 8, 2026
2 checks passed
@bburda bburda deleted the feat/rosbag-generation branch February 8, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable snapshot and rosbag recording in demo scenarios

2 participants