跳到正文
Skillpedia
分析与电子表格12k · #11555

rerun-mcap

它能做什么

该技能指导智能体把 MCAP 录制文件转换为 Rerun 可以显示的数据。适用于以 MCAP 格式记录机器人或传感器日志的人。

适用场景

  • ✓当你想转换 MCAP 录制文件,以便在 Rerun 中查看时。
  • ✓当你需要选择包含哪些 MCAP 主题,或如何解码自定义 protobuf 消息时。
  • ✓当转换后的 MCAP 数据为空,你需要找出原因时。

技能链接

https://github.com/rerun-io/rerun/blob/main/skills/rerun-mcap/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/rerun-io/rerun/blob/main/skills/rerun-mcap/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的 MCAP 录制文件转换到 Rerun 后结果是空的。问题出在哪里?”

每周 5 个新技能,1 分钟读完。

工作原理

该技能说明录制文件中的每个主题如何变成 Rerun 实体,以及哪些标准消息类型应保持原样。它还列出了输出为空的常见原因。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Rerun MCAP ingestion

McapReader turns an MCAP file into a lazy chunk stream: one entity per topic at the topic's path, message payloads decoded by pluggable decoders. This skill covers the reader's options, what each topic becomes, and the failure modes that yield an empty stream with no error. Stream mechanics (filter, drop, lenses, merge, write) are in rerun-chunk-processing.

The API

from rerun.chunk import McapReader

reader = McapReader(mcap_path)  # see help(McapReader) for the full option set
stream = reader.stream()

A URDF embedded in the MCAP can be ingested as well (then see rerun-urdf).

What a topic becomes

With the default decoders (decoders=None), the message schema name decides what a topic becomes — pass archetypes through, lens only the raw :message topics:

MCAP schema name decodes to what to do
foxglove.FrameTransforms Transform3D pass through; do not hand-build
foxglove.CameraCalibration Pinhole pass through
foxglove.CompressedVideo VideoStream (real sample bytes) + CoordinateFrame pass through
other foxglove.* well-known types the matching archetype pass through
ros2 well-known types (ros2msg / ros2_reflection) archetype pass through
your own schemas.proto.* / custom protobuf one <schema.name>:message struct attach semantics with a DeriveLens + Selector

So a camera topic already arrives as Pinhole, its video as VideoStream, and a frame_transforms topic as Transform3D — only custom messages (e.g. a custom joint states schema, a custom gripper status enum) come through reflection or raw only and need lenses.

The foxglove decoder does the schema→archetype mapping; because foxglove messages are protobuf-encoded it rides on the protobuf decoder, so keep decoders=None (verified: decoders=["protobuf"] alone leaves foxglove.CameraCalibration a raw :message; adding foxglove makes it a Pinhole). Confirm on your file: McapReader(path).stream(), then read McapSchema:name and a few Chunk.format() before deciding anything is missing or needs rebuilding.

  • Entity path = topic name (/sensors/joint_states stays /sensors/joint_states). Filter early: McapReader(path).stream().filter(content="/sensors/**").
  • A reflection-decoded message lands as one struct component named <fully.qualified.MessageName>:message. Navigate it with Selector (Selector(".joint_positions")) inside lenses; this is how custom messages get Rerun semantics attached (see the DeriveLens patterns in rerun-chunk-processing).
  • Topic regexes use RE2 syntax and are not anchored: cam matches /external/cam_low and /camera_info. Anchor explicitly (^/external/cam) when it matters. Prefer reader-level topic filtering over .filter(...) when you can, so excluded topics are never decoded at all.

When to use the low-level mcap package instead

McapReader keeps payloads in columnar chunk streams; that is almost always what you want. Drop to mcap.reader.make_reader only when you need raw record metadata without payloads, or when you need to rewrite the container itself (re-registering schemas, channels, and messages).

Gotchas

  1. Empty stream, no error: a topic regex that matched nothing, or a channel whose decoder produced no rows. Check Chunk.format() on a few chunks of reader.stream().to_chunks() against a tiny test file, or compare topic names with the mcap CLI / package first.
  2. Topic regexes are unanchored RE2; excludes run after includes.
  3. timeline_type="timestamp" interprets MCAP log times as wall-clock ns since epoch. If the recording's clock is wrong, fix it at the reader with timestamp_offset_ns rather than mutating timestamps downstream.
  4. Decoder subsets silently skip topics no decoder claims; when a topic is missing, retry with decoders=None to rule out decoder selection.
  5. Example fix-lenses are dataset-specific. Before copying a MutateLens like the Pinhole:resolution swap from the robot_data_preprocessing example, read the raw component from McapReader(path).stream() and confirm the defect exists in your data — applied blindly it corrupts correct calibration (a correct 648×480 flipped to 480×648).
  6. foxglove derives both the camera's Pinhole:child_frame and the video's CoordinateFrame:frame from each message's .frame_id (plus an image-plane
常见问题

该技能能解码我自己的消息类型吗?

能。它涵盖解码自定义 protobuf 消息,每种消息类型会变成一个结构化组件。

为什么有些主题应该原样传递?

坐标变换和相机标定等标准类型已经可以解码为 Rerun 类型,因此该技能要求保持它们原样。

它涵盖录制文件中存储的机器人模型吗?

文件中的机器人模型由相关技能 rerun-urdf 处理。

详情

作者的原始描述

Ingest MCAP files into Rerun chunk streams with rerun.chunk.McapReader. Read when converting an MCAP recording, selecting topics or decoders, decoding custom protobuf messages, or when an MCAP-derived stream comes out empty. Builds on rerun-chunk-processing (stream mechanics) and rerun-data-model (what the topics should become).

repo: rerun-io/rerun

热度

GitHub 星标
12k
排名
#11555
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能