Skip to main content

MCAP capture

MCAP is the open-source successor to ROS bag files. Roboticks’s mcap_capture context manager records the topics you care about, only during the test, and uploads the resulting .mcap to the platform automatically when the test fails (or always, if you ask).
Per-test recording, not session-wide. A failing nightly suite produces one MCAP per failing test — no 30-GB monolith to scrub through.

Install

MCAP is an optional extra to keep the SDK install light for users who don’t record:
This pulls in mcap and mcap-ros2-support. Without the extra, importing the context manager raises a clear error pointing at this install line.

The context manager

Parameters: Full reference: SDK MCAP capture.

Use the allowlist

The allowlist is the difference between a 3 MB bag and a 3 GB one. Subscribe-to-all is rarely what you want; most safety-relevant tests only need 2–5 topics.
Wildcards follow rosbag2 semantics: /safety/* matches every immediate child of /safety; ** matches recursively.

A typical safety test

When this test fails, the platform shows the MCAP under the test-run detail page. When it passes, no upload, no storage charge.

How MCAPs surface in the UI

Each failing test in the run detail UI gets:
  1. A download link to the raw .mcap.
  2. A Foxglove deep-link that opens the bag in Foxglove Studio with the relevant topics pre-selected.
  3. An LLM triage block that references timestamps inside the bag (“at t=4.2 s, /safety/estop_engaged is still false; expected true per @deadline(200)”).

Storage cost

MCAPs land in S3 standard for 90 days, then Glacier Deep Archive. See pricing.
  • Free tier: MCAPs auto-expire after 30 days.
  • Team / Enterprise: 0.05/GBmonthhot,0.05 / GB-month hot, 0.005 / GB-month archive.
A typical safety test produces 200 KB to 5 MB depending on topic rate. A nightly suite of 1,000 tests with 5% failure rate (upload_on="failure") and average 2 MB per failure is ~100 MB / night, or ~3 GB / month — well under $1 / month at hot pricing.
Set upload_on="always" on the handful of tests that always benefit from a bag (interactive perception tuning, regression hunts). Leave the rest on "failure".

Multi-test sessions

For session-scoped recording (one bag per session, not per test) use a session-level pytest fixture instead. That’s an explicit choice — the default is per-test for noise isolation.

Interaction with fault injection

mcap_capture records the post-fault topic — exactly what the system under test observed. Pair it with delay_messages or drop_messages to capture the degraded signal an auditor will want to see:

Next

MCAP API reference

Full parameter list and edge cases.

Fault injection

Often paired with MCAP for failure forensics.

LLM triage

How the platform reads your MCAP to explain failures.

Pricing

Storage costs in detail.