Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro rolling showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro crystal showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro lunar showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro indigo showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro kinetic showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)
No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.

Repository Summary

Checkout URI https://github.com/selfpatch/ros2_medkit.git
VCS Type git
VCS Version main
Last Updated 2026-10-06
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

selfpatch.ai

ros2_medkit: see what broke on any ROS 2 robot, from one REST API.

CI codecov Docs License ROS 2 Jazzy | Humble | Lyrical Discord

ros2_medkit gives your ROS 2 robot a diagnostics REST API. It finds every node, topic, service and action by itself, and turns failures - error logs, failed actions, /diagnostics - into clear faults: what broke, where, how bad, with a snapshot and a rosbag of the moment it happened. No changes to your code.

Quick start

  1. Get Docker, if you don’t have it yet.

  2. While your robot is running, start ros2_medkit on its computer:

   docker run --rm --network host --ipc host \
     -e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
     -e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
     ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
     ros2 launch ros2_medkit_gateway bringup.launch.py
   

On Humble or Lyrical, change jazzy to humble or lyrical.

  1. See what it found:
   curl localhost:8080/api/v1/apps     # every node on your robot
   curl localhost:8080/api/v1/faults   # everything that has failed
   

Or browse the whole API at localhost:8080/api/v1/docs.

[!TIP] That’s it. ros2_medkit is now watching your robot, and every new failure shows up as a fault.

No robot at hand? The sensor demo runs on any laptop and lets you break things on purpose (it needs curl and jq):

git clone https://github.com/selfpatch/selfpatch_demos.git
cd selfpatch_demos/demos/sensor_diagnostics
./run-demo.sh     # web UI on http://localhost:3000
./inject-nan.sh   # break a sensor, then watch the fault appear

What a fault looks like
After a Nav2 goal is aborted: ```jsonc // GET /api/v1/faults { "items": [ { "fault_code": "ACTION_NAVIGATE_TO_POSE_ABORTED", "severity_label": "ERROR", "status": "CONFIRMED", "reporting_sources": ["/bt_navigator"] } ], "x-medkit": { "count": 1 } } ``` Each fault also keeps a snapshot of the moment it happened and a rosbag of the seconds around it: ```bash curl localhost:8080/api/v1/apps/bt_navigator/faults/ACTION_NAVIGATE_TO_POSE_ABORTED curl -O -J localhost:8080/api/v1/apps/bt_navigator/bulk-data/rosbags/ACTION_NAVIGATE_TO_POSE_ABORTED ```
Watch faults live, or add the web UI
```bash # Faults as they happen curl -N localhost:8080/api/v1/faults/stream # A dashboard in the browser: open http://localhost:3000, click Connect, enter http://localhost:8080 docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest ``` See the [web UI tutorial](https://selfpatch.github.io/ros2_medkit/tutorials/web-ui.html) and the File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/README.md)

CONTRIBUTING

Contributing to ros2_medkit

Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code.

How to Report Issues

Did you find a bug?

  • Ensure the bug was not already reported by searching Issues
  • If you can’t find an existing issue, open a new one and select the Bug report template
  • Fill in all sections of the template:
    • Steps to reproduce - numbered steps to recreate the issue
    • Expected behavior - what you expected to happen
    • Actual behavior - what actually happened, including error messages or stack traces
    • Environment - ros2_medkit version, ROS 2 distro, OS
    • Additional information - logs, snippets, or screenshots if helpful

Do you want to suggest a feature or improvement?

  • Check if the feature has already been suggested in Issues
  • If not, open a new issue and select the Feature request / General issue template
  • Fill in all sections:
    • Proposal - describe the change or feature you’d like to see
    • Motivation - why is this important? Who does it benefit?
    • Alternatives considered - other options or implementations you considered
    • Additional context - any other context or screenshots

How to Contribute Code

Development Workflow

  1. Fork the repository and clone your fork locally
  2. Install pre-commit hooks (one-time setup):
   pip install pre-commit
   pre-commit install
   
  1. Create a branch from main with a descriptive name:
    • feature/short-description for new features
    • fix/short-description for bug fixes
    • docs/short-description for documentation changes
  2. Make your changes following the project’s coding standards
  3. Test your changes locally (see Build and Test section below)
  4. Commit your changes with clear, descriptive commit messages
    • Pre-commit hooks will automatically check formatting
  5. Push your branch to your fork
  6. Open a Pull Request against the main branch of this repository

Commit Messages

  • Use clear and descriptive commit messages
  • Start with a verb in imperative mood (e.g., “Add”, “Fix”, “Update”, “Remove”)
  • Keep the first line under 72 characters
  • Add a blank line followed by a more detailed explanation if needed

Examples:

Add support for SOVD entity mapping

Fix memory leak in diagnostic tree traversal

Update documentation for colcon build process

Build and Test

Before opening or updating a Pull Request, you must build and test locally:

source /opt/ros/jazzy/setup.bash   # or humble - adjust for your distro
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install && source install/setup.bash

Use scripts/test.sh for testing (preferred over raw colcon commands):

./scripts/test.sh              # Unit tests only (default)
./scripts/test.sh integ        # Integration tests only
./scripts/test.sh lint         # Fast linters (no clang-tidy)
./scripts/test.sh all          # Everything
./scripts/test.sh <test_name>  # Single test by CTest name regex

Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. colcon test-result counts any XML under build/ whose root element is <testsuite> or <testsuites>, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with ./scripts/drop_stale_results.sh if you invoke colcon test directly.

Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container’s /dev/shm is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is fastdds shm clean, the vendor’s own tool, which removes a segment only when no process holds its lock. Run it on its own with ./scripts/sweep_shm.sh; it refuses while ROS processes are alive, and --force overrides that.

Pre-commit and Pre-push Hooks

File truncated at 100 lines see the full file

# Contributing to ros2_medkit Thanks for your interest in contributing to ros2_medkit! This guide explains how to report issues, suggest features, and contribute code. ## How to Report Issues ### Did you find a bug? - **Ensure the bug was not already reported** by searching [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If you can't find an existing issue, [open a new one](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Bug report** template - Fill in all sections of the template: - **Steps to reproduce** - numbered steps to recreate the issue - **Expected behavior** - what you expected to happen - **Actual behavior** - what actually happened, including error messages or stack traces - **Environment** - ros2_medkit version, ROS 2 distro, OS - **Additional information** - logs, snippets, or screenshots if helpful ### Do you want to suggest a feature or improvement? - Check if the feature has already been suggested in [Issues](https://github.com/selfpatch/ros2_medkit/issues) - If not, [open a new issue](https://github.com/selfpatch/ros2_medkit/issues/new/choose) and select the **Feature request / General issue** template - Fill in all sections: - **Proposal** - describe the change or feature you'd like to see - **Motivation** - why is this important? Who does it benefit? - **Alternatives considered** - other options or implementations you considered - **Additional context** - any other context or screenshots ## How to Contribute Code ### Development Workflow 1. **Fork the repository** and clone your fork locally 2. **Install pre-commit hooks** (one-time setup): ```bash pip install pre-commit pre-commit install ``` 3. **Create a branch** from `main` with a descriptive name: - `feature/short-description` for new features - `fix/short-description` for bug fixes - `docs/short-description` for documentation changes 4. **Make your changes** following the project's coding standards 5. **Test your changes** locally (see Build and Test section below) 6. **Commit your changes** with clear, descriptive commit messages - Pre-commit hooks will automatically check formatting 7. **Push your branch** to your fork 8. **Open a Pull Request** against the `main` branch of this repository ### Commit Messages - Use clear and descriptive commit messages - Start with a verb in imperative mood (e.g., "Add", "Fix", "Update", "Remove") - Keep the first line under 72 characters - Add a blank line followed by a more detailed explanation if needed Examples: ``` Add support for SOVD entity mapping Fix memory leak in diagnostic tree traversal Update documentation for colcon build process ``` ### Build and Test Before opening or updating a Pull Request, you **must** build and test locally: ```bash source /opt/ros/jazzy/setup.bash # or humble - adjust for your distro rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install && source install/setup.bash ``` Use `scripts/test.sh` for testing (preferred over raw colcon commands): ```bash ./scripts/test.sh # Unit tests only (default) ./scripts/test.sh integ # Integration tests only ./scripts/test.sh lint # Fast linters (no clang-tidy) ./scripts/test.sh all # Everything ./scripts/test.sh # Single test by CTest name regex ``` Every run starts by dropping the result files of the previous one, so the summary it prints is the tally of the run you just started and not of everything tested since the last clean. `colcon test-result` counts any XML under `build/` whose root element is `` or ``, whatever it is called, so the sweep asks colcon itself which files those are rather than matching a name. Run it on its own with `./scripts/drop_stale_results.sh` if you invoke `colcon test` directly. Every run also reclaims shared memory left behind by DDS participants that were killed rather than shut down. The aggregation suites kill peers on purpose, and nothing gives those segments back: about 0.65 MB each, and a container's `/dev/shm` is 64 MB by default, so they accumulate across runs until something unrelated fails for lack of space. The reclaiming is `fastdds shm clean`, the vendor's own tool, which removes a segment only when no process holds its lock. Run it on its own with `./scripts/sweep_shm.sh`; it refuses while ROS processes are alive, and `--force` overrides that. #### Pre-commit and Pre-push Hooks File truncated at 100 lines [see the full file](https://github.com/selfpatch/ros2_medkit/tree/main/CONTRIBUTING.md)