本文へスキップ
Skillpedia
分析とスプレッドシート12k · #11550

rerun-chunk-processing

できること

このスキルは、元のファイルを読み込んでから最適化された録画を書き出すまで、Rerunのチャンク処理の仕組みをAIに教えます。ロボットやセンサーのデータを変換したり整理したりする開発者に向けたものです。

使う場面

  • ✓MCAP、Parquet、動画ファイルをRerunの形式に変換するコードを書いているとき。
  • ✓既存の.rrd録画を前処理したいとき。
  • ✓古いデータ変換ツールを、Rerunのreaderとlensのパイプラインに移植しているとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/rerun-io/rerun/blob/main/skills/rerun-chunk-processing/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“MCAPファイルを読み込み、lensを適用し、最適化された録画を保存するRerunのパイプラインを書いてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、readerがどのようにデータチャンクを作り、streamとlensがそれをどう変えるか、そして最後の呼び出しでパイプラインを実行して結果を保存する仕組みを説明します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Rerun chunk processing

The pipeline layer between raw data and an RRD: readers produce Chunks, streams transform them, terminal calls execute. This skill is the generic mechanics only. Decide the data model first (rerun-data-model), then pick the importer skill for each source:

Source Reader Skill
MCAP file (ROS2, protobuf, Foxglove) McapReader(path).stream() rerun-mcap
URDF robot model (+ joint states → FK) UrdfTree.from_file_path(...).stream() rerun-urdf
Parquet table (trajectories, sensor logs) ParquetReader(path).stream() rerun-parquet
mp4 camera video Mp4Reader(path).stream() rerun-mp4
HDF5 file (groups → entities) Hdf5Reader(path).stream() none yet
LeRobot dataset directory built-in importer, then RrdReader rerun-lerobot
Existing RRD RrdReader(path) here, below
Sidecar files (JSON calib, metadata) Chunk.from_columns + from_iter here, below

The API is rerun.chunk; when behavior matters, check the installed surface: python -c "from rerun.chunk import LazyChunkStream; help(LazyChunkStream)".

Decision rule: where does each component come from?

Default: a reader produces the chunks; lenses shape them. Walk this before writing any conversion code — most "build it by hand" instincts are wrong here:

  1. Source a reader supports? Use the reader's .stream(); never hand-parse and re-log. MCAP→McapReader, URDF→UrdfTree, parquet→ParquetReader, mp4→Mp4Reader, HDF5→Hdf5Reader, RRD→RrdReader, LeRobot dir→log_file_from_path.
  2. A decoder already emits the archetype? Foxglove gives Transform3D, Pinhole, VideoStream (real sample bytes) ready-made — pass it through, do not re-derive. Only custom-protobuf topics arrive as <Name>:message and need a lens (see rerun-mcap).
  3. Fix an existing component in place (swapped resolution, recolor, unit convert)? MutateLens, output_mode="forward_unmatched".
  4. Derive a new component/entity (FK→/tf, scalars from a message)? DeriveLens. To scatter one row into N (a joint batch → per-joint /tf), use the two-lens pair: derive the batch with output_mode="forward_all" (keeps the originals, e.g. the joint states), then a second DeriveLens with scatter=True and output_mode="drop_unmatched" (emits only the scattered rows). See the robot_data_preprocessing example.
  5. Genuine sidecar no reader or lens can produce (JSON calibration offsets, hand-measured extrinsics, external metadata)? Chunk.from_columns + from_iter.
  6. Finish with LazyChunkStream.merge(...) → .collect(optimize=OptimizationProfile.OBJECT_STORE) → write_rrd(application_id, recording_id).

Why this order: the pipeline stays lazy, columnar, multithreaded, and OBJECT_STORE-optimizable. A hand-built row loop or an out-of-lens pa.array throws all of that away — that is the path we are deliberately avoiding.

Anti-patterns (use a reader + lens instead)

If you are writing the left, stop and use the right:

  • for-loop building rows/components → a lens with a Selector(...).pipe(...) PyArrow-compute callback.
  • rr.init + rr.log per message for conversion → that is live logging; for ingestion, read with a reader and write_rrd.
  • chunk.to_record_batch() + pc.filter then rebuilding via Chunk.from_columns (row-thinning by hand) → stream.drop(content=...), .split(...), or a MutateLens returning a filtered pa.array.
  • pa.array / pa.RecordBatch / np.frombuffer assembled OUTSIDE a lens → move the transform inside a MutateLens/DeriveLens selector callback.
  • rr.send_columns hand-assembled from a custom parser → use the matching reader; it produces chunks directly.
  • Parsing MCAP/URDF with a non-Rerun library then re-logging → McapReader / UrdfTree.
  • Chunk.from_columns for data a reader already decodes (Pinhole intrinsics, VideoStream, Transform3D from a transforms topic) → keep it in the reader stream; fix with a MutateLens if neede
よくある質問

チャンクは手で作るべきですか?

既存のreaderとlensがある場合はそれを使い、外部のメタデータの場合にだけ手でチャンクを作るようスキルは述べています。

どのreaderが挙げられていますか?

MCAP、URDF、Parquet、mp4動画、LeRobotデータセット用のreaderと、RRDファイル用のものが挙げられています。

先にデータモデルを決めるべきですか?

はい。スキルは、先にrerun-data-modelスキルを使ってデータモデルを決めるよう述べています。

詳細

作者による元の説明

Core mechanics of the Rerun Chunk Processing API (rerun.chunk) — LazyChunkStream pipelines, Chunk, lenses (MutateLens/DeriveLens/Selector), RrdReader, writing optimized RRDs. Read BEFORE writing any ingestion/conversion/preprocessing code (convert an MCAP, build a recording from a dataset, preprocess an .rrd, port an old converter): it mandates reader+lens pipelines and steers away from hand-built chunks — no Chunk.from_columns for data a reader/lens can produce, no per-message rr.log, no manual pa.array assembly. Source-specific knowledge lives in the importer skills (rerun-mcap, rerun-urdf,

repo: rerun-io/rerun

人気

GitHubのスター
12k
ランキング
#11550
ライセンス
Apache-2.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル