rerun-chunk-processing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rerun chunk processing

Rerun Chunk 处理

The pipeline layer between raw data and an RRD: readers produce
Chunk
s, 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:
SourceReaderSkill
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
LeRobot dataset directorybuilt-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.experimental
; when behavior matters, check the installed surface:
python -c "from rerun.experimental import LazyChunkStream; help(LazyChunkStream)"
.
原始数据与 RRD 之间的流水线层:reader 生成
Chunk
,流对其进行转换,最终调用执行处理。本技能仅涵盖通用机制。请先确定数据模型(
rerun-data-model
),再为每个数据源选择对应的导入器技能:
数据源Reader技能
MCAP 文件(ROS2、protobuf、Foxglove)
McapReader(path).stream()
rerun-mcap
URDF 机器人模型(+ 关节状态 → 正向运动学)
UrdfTree.from_file_path(...).stream()
rerun-urdf
Parquet 表(轨迹、传感器日志)
ParquetReader(path).stream()
rerun-parquet
MP4 相机视频
Mp4Reader(path).stream()
rerun-mp4
LeRobot 数据集目录内置导入器,之后使用
RrdReader
rerun-lerobot
现有 RRD 文件
RrdReader(path)
本文档下方介绍
辅助文件(JSON 校准文件、元数据)
Chunk.from_columns
+
from_iter
本文档下方介绍
该 API 属于
rerun.experimental
;若需确认具体行为,请查看已安装版本的 API 接口:
python -c "from rerun.experimental 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
    , 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.
默认规则:由 reader 生成 Chunk;由 Lens 调整其形态。在编写任何转换代码前,请遵循以下步骤——大多数“手动构建”的直觉都是错误的:
  1. 数据源受 reader 支持? 使用该 reader 的
    .stream()
    方法;切勿手动解析并重新记录。MCAP→
    McapReader
    ,URDF→
    UrdfTree
    ,Parquet→
    ParquetReader
    ,MP4→
    Mp4Reader
    ,RRD→
    RrdReader
    ,LeRobot 目录→
    log_file_from_path
    。
  2. 解码器已输出对应原型? Foxglove 会直接生成
    Transform3D
    、
    Pinhole
    、
    VideoStream
    (真实样本字节)——直接传递即可,无需重新推导。只有自定义 protobuf 主题会以
    <Name>:message
    形式传入,需要使用 Lens 处理(参见
    rerun-mcap
    )。
  3. 原地修复现有组件(分辨率互换、重着色、单位转换)?使用
    MutateLens
    ,设置
    output_mode="forward_unmatched"
    。
  4. 推导新组件/实体(正向运动学→
    /tf
    、从消息中提取标量)?使用
    DeriveLens
    。若要将一行数据拆分为多行(如关节批量数据→每个关节对应一条
    /tf
    ),请使用双 Lens 组合:先用
    output_mode="forward_all"
    推导批量数据(保留原始数据,如关节状态),再用第二个
    DeriveLens
    设置
    scatter=True
    和
    output_mode="drop_unmatched"
    (仅输出拆分后的行)。请参见
    robot_data_preprocessing
    示例。
  5. 真正的辅助数据(reader 或 Lens 无法生成的内容,如 JSON 校准偏移量、手动测量的外参、外部元数据)?使用
    Chunk.from_columns
    +
    from_iter
    。
  6. 最后执行
    LazyChunkStream.merge(...)
    →
    .collect(optimize=OptimizationProfile.OBJECT_STORE)
    →
    write_rrd(application_id, recording_id)
    。
为何遵循此顺序:流水线保持惰性、列式、多线程,且可通过
OBJECT_STORE
优化。手动构建的行循环或 Lens 外的
pa.array
组装会破坏所有这些优势——这正是我们刻意避免的路径。

Anti-patterns (use a reader + lens instead)

反模式(改用 reader + Lens)

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 needed.
A wall of
pyarrow.compute
"missing-attribute" type errors (
pc.filter
,
pc.list_element
) usually means
pc.*
calls sit in module-level helpers instead of inside
Selector.pipe
lens callbacks. Refactor into a lens before suppressing the checker — the errors are a smell that the hand-building should not exist.
Porting an existing converter? Hand-built converters predate decoder improvements and are not ground truth. Re-verify the decoder output (step 2) and check every
Chunk.from_columns
/ for-loop against this list before copying.
若你正在编写左侧的代码,请停止并改用右侧的方案:
  • for
    循环构建行/组件
    → 使用带有
    Selector(...).pipe(...)
    PyArrow 计算回调的 Lens。
  • 转换时使用
    rr.init
    +
    rr.log
    逐消息记录
    → 这是_实时_记录;对于数据摄入,请使用 reader 读取并调用
    write_rrd
    。
  • chunk.to_record_batch()
    +
    pc.filter
    再通过
    Chunk.from_columns
    重建
    (手动精简行)→ 使用
    stream.drop(content=...)
    、
    .split(...)
    或返回过滤后
    pa.array
    的
    MutateLens
    。
  • 在 Lens 外组装
    pa.array
    /
    pa.RecordBatch
    /
    np.frombuffer
    → 将转换逻辑移至
    MutateLens
    /
    DeriveLens
    的 selector 回调中。
  • 手动组装
    rr.send_columns
    的自定义解析器
    → 使用匹配的 reader;它会直接生成 Chunk。
  • 使用非 Rerun 库解析 MCAP/URDF 后重新记录 → 使用
    McapReader
    /
    UrdfTree
    。
  • 对 reader 已解码的数据使用
    Chunk.from_columns
    (如
    Pinhole
    内参、
    VideoStream
    、来自变换主题的
    Transform3D
    )→ 保留在 reader 流中;如需调整,使用
    MutateLens
    。
大量 PyArrow 计算的“缺失属性”类型错误(
pc.filter
、
pc.list_element
)通常意味着
pc.*
调用位于模块级辅助函数中,而非
Selector.pipe
的 Lens 回调内。在抑制检查器错误前,请重构为 Lens——这些错误是手动构建逻辑不应存在的信号。
迁移现有转换器? 手动构建的转换器早于解码器改进,并非最优方案。迁移前,请重新验证解码器输出(步骤 2),并对照此列表检查每个
Chunk.from_columns
/for 循环。

Core model

核心模型

  • LazyChunkStream
    is a lazy pipeline DAG, not a collection. Building filters, lenses, maps, splits, and merges reads no source data.
  • Execution starts at terminal calls:
    write_rrd(...)
    ,
    collect()
    ,
    to_chunks()
    , or iterating the stream.
  • Execution is streaming, multithreaded, and mostly GIL-free. Prefer stream/lens operations and PyArrow compute over Python row loops.
  • Move semantics: builder calls (
    filter
    ,
    drop
    ,
    lenses
    ,
    map
    ,
    flat_map
    ) consume the input stream; reusing a consumed stream raises. Reassign after each step. Terminal calls do not consume, but each terminal call re-executes the whole pipeline;
    collect()
    once if that is too costly.
  • ChunkStore
    is materialized in memory (
    stream.collect()
    ,
    ChunkStore.from_chunks
    ).
    LazyStore
    is manifest-indexed, loads chunks on demand (
    RrdReader(path).store()
    , catalog segment stores). Both have
    schema()
    ,
    summary()
    ,
    stream()
    , and
    write_rrd(...)
    .
  • LazyChunkStream
    是惰性流水线有向无环图,而非集合。构建过滤器、Lens、映射、拆分和合并操作不会读取源数据。
  • 执行从最终调用开始:
    write_rrd(...)
    、
    collect()
    、
    to_chunks()
    或遍历流。
  • 执行过程是流式、多线程且基本无需 GIL。优先使用流/Lens 操作和 PyArrow 计算,而非 Python 行循环。
  • 移动语义:构建器调用(
    filter
    、
    drop
    、
    lenses
    、
    map
    、
    flat_map
    )会消耗输入流;复用已消耗的流会引发错误。每步操作后重新赋值。最终调用不会消耗流,但每次最终调用都会重新执行整个流水线;若成本过高,请仅调用一次
    collect()
    。
  • ChunkStore
    在内存中实例化(
    stream.collect()
    、
    ChunkStore.from_chunks
    )。
    LazyStore
    基于清单索引,按需加载 Chunk(
    RrdReader(path).store()
    、目录段存储)。两者均提供
    schema()
    、
    summary()
    、
    stream()
    和
    write_rrd(...)
    方法。

Stream composition

流组合

python
from rerun.experimental import Chunk, LazyChunkStream, OptimizationProfile
  • stream.filter(content=, has_timeline=, is_static=, components=)
    keeps the matching portion of each chunk;
    stream.drop(...)
    is its complement, same keyword filters.
    content
    takes an entity-path glob or a list of them.
  • stream.map(fn)
    applies
    Chunk -> Chunk
    ;
    stream.flat_map(fn)
    applies
    Chunk -> Iterable[Chunk]
    . Escape hatches for chunk-level Python logic; prefer lenses for columnar work.
  • stream.split(content=, ...)
    returns
    (matching, non_matching)
    ; both branches share the same upstream.
  • LazyChunkStream.merge(*streams)
    fans in any number of sources.
  • LazyChunkStream.from_iter(chunks)
    wraps hand-built chunks.
python
stream = source_stream()  # any importer skill
stream = stream.drop(content="/video_raw/**")
stream = stream.lenses(fix_lens, content="/cam/**", output_mode="forward_unmatched")
merged = LazyChunkStream.merge(stream, sidecar_stream)
merged.write_rrd(out_path, application_id="my_app", recording_id=recording_id)
python
from rerun.experimental import Chunk, LazyChunkStream, OptimizationProfile
  • stream.filter(content=, has_timeline=, is_static=, components=)
    保留每个 Chunk 中匹配的部分;
    stream.drop(...)
    是其互补操作,使用相同的关键字过滤器。
    content
    接受实体路径通配符或路径列表。
  • stream.map(fn)
    应用
    Chunk -> Chunk
    转换;
    stream.flat_map(fn)
    应用
    Chunk -> Iterable[Chunk]
    转换。这是 Chunk 级 Python 逻辑的逃生舱;对于列式处理,优先使用 Lens。
  • stream.split(content=, ...)
    返回
    (matching, non_matching)
    ;两个分支共享同一上游流。
  • LazyChunkStream.merge(*streams)
    合并任意数量的源流。
  • LazyChunkStream.from_iter(chunks)
    包装手动构建的 Chunk。
python
stream = source_stream()  # 任意导入器技能
stream = stream.drop(content="/video_raw/**")
stream = stream.lenses(fix_lens, content="/cam/**", output_mode="forward_unmatched")
merged = LazyChunkStream.merge(stream, sidecar_stream)
merged.write_rrd(out_path, application_id="my_app", recording_id=recording_id)

Hand-built chunks — sidecar only

手动构建 Chunk — 仅用于辅助数据

Use
Chunk.from_columns
ONLY for data no reader or lens can emit — JSON/CSV calibration, frame offsets, external metadata. If a reader (
McapReader
/
UrdfTree
/
ParquetReader
) decodes the topic or a lens can derive it, that is the idiomatic path; do not hand-assemble it here. In the
robot_data_preprocessing
example the only hand-built chunk is the JSON offsets sidecar; the camera fix, FK→
/tf
, meshes, and recolor are all readers + lenses.
Chunk.from_columns(entity_path, indexes, columns)
mirrors
rr.send_columns(...)
and accepts the same archetype
.columns(...)
helpers. Empty
indexes
means static.
python
chunk = Chunk.from_columns(
    "/tf_static/robot_offsets",
    indexes=[],  # static
    columns=rr.Transform3D.columns(
        translation=translations,
        quaternion=quaternions_xyzw,
        parent_frame=parents,
        child_frame=children,
    ),
)
sidecar_stream = LazyChunkStream.from_iter([chunk])
rr.AnyValues.columns(...)
covers non-standard metadata fields. For inspection, a
Chunk
exposes
entity_path
,
num_rows
,
is_static
,
timeline_names
,
to_record_batch()
, and
format()
(human-readable table).
仅当 reader 或 Lens 无法生成数据时,才使用
Chunk.from_columns
——如 JSON/CSV 校准数据、帧偏移量、外部元数据。若 reader(
McapReader
/
UrdfTree
/
ParquetReader
)可解码该主题,或 Lens 可推导得出,则应使用标准路径;请勿在此手动组装。在
robot_data_preprocessing
示例中,唯一手动构建的 Chunk 是 JSON 偏移量辅助数据;相机修复、正向运动学→
/tf
、网格和重着色均通过 reader + Lens 实现。
Chunk.from_columns(entity_path, indexes, columns)
与
rr.send_columns(...)
对应,并接受相同的原型
.columns(...)
辅助方法。空
indexes
表示静态数据。
python
chunk = Chunk.from_columns(
    "/tf_static/robot_offsets",
    indexes=[],  # 静态数据
    columns=rr.Transform3D.columns(
        translation=translations,
        quaternion=quaternions_xyzw,
        parent_frame=parents,
        child_frame=children,
    ),
)
sidecar_stream = LazyChunkStream.from_iter([chunk])
rr.AnyValues.columns(...)
涵盖非标准元数据字段。用于检查时,
Chunk
暴露
entity_path
、
num_rows
、
is_static
、
timeline_names
、
to_record_batch()
和
format()
(人类可读表格)方法。

Lenses

Lens

Lenses reshape, fix, or derive components without iterating rows. Apply with
stream.lenses(lenses, output_mode=..., content=...)
.
  • MutateLens(component, selector, keep_row_ids=False)
    modifies an existing component in place.
  • DeriveLens(component, output_entity=None, scatter=False)
    creates new columns, optionally at another entity. Chain
    .to_component(descriptor, selector)
    per output;
    .to_timeline(name, "sequence" | "duration_ns" | "timestamp_ns", selector)
    extracts a time column from the data itself.
    scatter=True
    explodes one input row into N output rows (one per list element).
  • Scope with
    content=
    whenever the same component name exists under multiple entities.
Output modes, and the default is
drop_unmatched
:
  • drop_unmatched
    (default): only lens outputs survive. Right for derive-only intermediate streams; silently discards everything else if applied broadly.
  • forward_unmatched
    : lens outputs plus the original components no lens consumed. Right for targeted fixes that preserve the rest of the stream.
  • forward_all
    : lens outputs plus all originals, including consumed ones. Can duplicate data.
In-place fix (keep Arrow type and length intact):
python
stream = stream.lenses(
    MutateLens(
        "Pinhole:resolution",
        Selector(".").pipe(
            lambda res: pa.array(
                [(h, w) for w, h in res.to_pylist()],
                type=res.type,
            )
        ),
    ),
    content=["/external/cam_low", "/external/cam_high"],
    output_mode="forward_unmatched",
)
Derive with unit conversion (PyArrow compute, no Python loop):
python
DeriveLens("schemas.proto.JointState:message", output_entity="/joints_deg/waist").to_component(
    rr.Scalars.descriptor_scalars(),
    Selector(".joint_positions").pipe(lambda arr: pc.multiply(pc.list_element(arr, 0), 180.0 / math.pi)),
)
Lens 可在不遍历行的情况下重塑、修复或推导组件。通过
stream.lenses(lenses, output_mode=..., content=...)
应用。
  • MutateLens(component, selector, keep_row_ids=False)
    原地修改现有组件。
  • DeriveLens(component, output_entity=None, scatter=False)
    创建新列,可选择输出到另一个实体。链式调用
    .to_component(descriptor, selector)
    定义每个输出;
    .to_timeline(name, "sequence" | "duration_ns" | "timestamp_ns", selector)
    从数据中提取时间列。
    scatter=True
    会将一行输入拆分为多行输出(每个列表元素对应一行)。
  • 当同一组件名称存在于多个实体下时,请使用
    content=
    限定作用域。
输出模式,默认值为
drop_unmatched
:
  • drop_unmatched
    (默认):仅保留 Lens 的输出。适用于仅推导的中间流;若广泛应用,会静默丢弃所有其他内容。
  • forward_unmatched
    :保留 Lens 的输出以及未被 Lens 处理的原始组件。适用于针对性修复,同时保留流的其余部分。
  • forward_all
    :保留 Lens 的输出以及所有原始组件,包括已被处理的组件。可能会导致数据重复。
原地修复(保持 Arrow 类型和长度不变):
python
stream = stream.lenses(
    MutateLens(
        "Pinhole:resolution",
        Selector(".").pipe(
            lambda res: pa.array(
                [(h, w) for w, h in res.to_pylist()],
                type=res.type,
            )
        ),
    ),
    content=["/external/cam_low", "/external/cam_high"],
    output_mode="forward_unmatched",
)
带单位转换的推导(使用 PyArrow 计算,无 Python 循环):
python
DeriveLens("schemas.proto.JointState:message", output_entity="/joints_deg/waist").to_component(
    rr.Scalars.descriptor_scalars(),
    Selector(".joint_positions").pipe(lambda arr: pc.multiply(pc.list_element(arr, 0), 180.0 / math.pi)),
)

Selector grammar

Selector 语法

Selector("<query>")
navigates nested Arrow data, jq-style:
  • .
    current value;
    .field
    struct field
  • []
    iterate list elements;
    [N]
    index a list
  • ?
    suppress errors / skip missing optionals;
    !
    assert non-null
  • |
    pipe one expression into another
.pipe(fn)
chains a Python/PyArrow transform (or another Selector).
.execute(array)
runs it eagerly;
.execute_per_row(array)
guarantees the output row count matches the input (use inside lens callbacks that must stay row-aligned).
Selector("<query>")
用于导航嵌套 Arrow 数据,类似 jq 风格:
  • .
    当前值;
    .field
    结构体字段
  • []
    遍历列表元素;
    [N]
    列表索引
  • ?
    抑制错误/跳过缺失的可选值;
    !
    断言非空
  • |
    将一个表达式的输出传递给另一个表达式
.pipe(fn)
链式调用 Python/PyArrow 转换(或另一个 Selector)。
.execute(array)
立即执行;
.execute_per_row(array)
保证输出行数与输入行数匹配(用于必须保持行对齐的 Lens 回调中)。

Writing RRDs

写入 RRD

  • stream.write_rrd(path, application_id=..., recording_id=...)
    executes and writes in one streaming pass.
  • stream.collect(optimize=OptimizationProfile.OBJECT_STORE).write_rrd(...)
    materializes, optimizes chunk layout, then writes. Memory scales with the materialized chunks.
  • Profiles:
    OBJECT_STORE
    (large chunks, for storage/query/catalog) and
    LIVE
    (small chunks, low-latency viewer).
  • Multiple physical RRDs form one logical recording when they share a
    recording_id
    ; use this to separate base data, model/URDF data, and layers.
Always use
OptimizationProfile.OBJECT_STORE
when the RRD is headed for a Rerun catalog or Hub, unless explicitly asked otherwise.
  • stream.write_rrd(path, application_id=..., recording_id=...)
    执行并通过一次流式传递写入。
  • stream.collect(optimize=OptimizationProfile.OBJECT_STORE).write_rrd(...)
    实例化数据、优化 Chunk 布局,然后写入。内存占用与实例化的 Chunk 规模成正比。
  • 配置文件:
    OBJECT_STORE
    (大 Chunk,用于存储/查询/目录)和
    LIVE
    (小 Chunk,低延迟查看器)。
  • 多个物理 RRD 文件若共享同一
    recording_id
    ,则构成一个逻辑录制文件;可用于分离基础数据、模型/URDF 数据和图层。
当 RRD 要上传至 Rerun 目录或 Hub 时,请始终使用
OptimizationProfile.OBJECT_STORE
,除非另有明确要求。

Chunk API vs logging API

Chunk API 与日志 API

  • Logging (
    rr.log
    ,
    rr.send_columns
    ,
    RecordingStream
    ) is for live logging from user code; chunk processing is for ingestion, conversion, and postprocessing existing recordings.
  • Logging → chunks: write an RRD, read it back with
    RrdReader
    .
    RrdReader(path)
    lists
    recordings()
    /
    blueprints()
    (each a
    StoreEntry
    with
    kind
    ,
    application_id
    ,
    recording_id
    );
    .stream(store=entry)
    for sequential passes,
    .store(store=entry)
    for indexed access.
  • Chunks → logging:
    rerun.experimental.send_chunks(chunks, recording=...)
    accepts a
    Chunk
    ,
    LazyChunkStream
    ,
    LazyStore
    ,
    ChunkStore
    , or any iterable of chunks. The source store's
    application_id
    /
    recording_id
    are not preserved; the active recording's identity wins.
  • 日志 API(
    rr.log
    、
    rr.send_columns
    、
    RecordingStream
    )用于从用户代码进行实时日志记录;Chunk 处理用于数据摄入、转换和后处理现有录制文件。
  • 日志→Chunk:写入 RRD,再用
    RrdReader
    读取。
    RrdReader(path)
    列出
    recordings()
    /
    blueprints()
    (每个都是带有
    kind
    、
    application_id
    、
    recording_id
    的
    StoreEntry
    );
    .stream(store=entry)
    用于顺序遍历,
    .store(store=entry)
    用于索引访问。
  • Chunk→日志:
    rerun.experimental.send_chunks(chunks, recording=...)
    接受
    Chunk
    、
    LazyChunkStream
    、
    LazyStore
    、
    ChunkStore
    或任何 Chunk 可迭代对象。源存储的
    application_id
    /
    recording_id
    不会被保留;当前活动录制文件的标识优先。

Common gotchas

常见陷阱

  • The default lens
    output_mode
    is
    drop_unmatched
    ; forgetting to set
    forward_unmatched
    on a targeted fix silently drops the rest of the stream.
  • Do not reuse a consumed
    LazyChunkStream
    ; reassign or
    split
    deliberately.
  • Scope lenses with
    content=
    ; the same component name often exists under many entities.
  • Preserve Arrow array type and length in
    MutateLens
    transforms.
  • For catalog layers, the layer
    recording_id
    must equal the segment id.
  • This is
    rerun.experimental
    ; pin-check signatures when upgrading.
  • Lens 默认输出模式为
    drop_unmatched
    ;若在针对性修复时忘记设置
    forward_unmatched
    ,会静默丢弃流的其余部分。
  • 请勿复用已消耗的
    LazyChunkStream
    ;请重新赋值或刻意使用
    split
    。
  • 使用
    content=
    限定 Lens 的作用域;同一组件名称通常存在于多个实体下。
  • 在
    MutateLens
    转换中保持 Arrow 数组的类型和长度不变。
  • 对于目录图层,图层的
    recording_id
    必须等于段 ID。
  • 本 API 属于
    rerun.experimental
    ;升级时请固定并检查签名。

References

参考资料

  • End-to-end example (MCAP + URDF + JSON sidecar, lenses, merge, optimize):
    https://github.com/rerun-io/rerun/tree/main/examples/python/robot_data_preprocessing
  • Docs:
    https://rerun.io/docs/concepts/logging-and-ingestion/chunk-processing-api
    ,
    https://rerun.io/docs/concepts/query-and-transform/lenses
  • 端到端示例(MCAP + URDF + JSON 辅助数据、Lens、合并、优化):
    https://github.com/rerun-io/rerun/tree/main/examples/python/robot_data_preprocessing
  • 文档:
    https://rerun.io/docs/concepts/logging-and-ingestion/chunk-processing-api
    ,
    https://rerun.io/docs/concepts/query-and-transform/lenses