// Docs

Converting to robot rows

Map generic rows into Refiner's robotics episode view

Use to_robot_rows(...) when a generic reader produces episode-shaped rows that should be treated as robotics episodes.

Basic mapping

pipeline = (
    mdr.read_hdf5(
        "/data/aloha/*.hdf5",
        datasets={
            "action": "action",
            "qpos": "observations/qpos",
            "front": "observations/images/front",
        },
        file_path_column="episode_file",
    )
    .to_robot_rows(
        episode_id_key="episode_file",
        action_key="action",
        state_key="qpos",
        video_keys=("front",),
        fps=30.0,
        robot_type="aloha",
    )
)

The input columns remain available by their original names. The robotics view adds semantic properties such as row.actions, row.states, and row.videos.

Key mapping

OptionUse it for
episode_id_keySource column or slash path for episode identity.
task_keySource column or slash path containing task text. Strings become row.tasks = [task]; string sequences are preserved.
fps or fps_keyLiteral fps or source column for fps.
robot_type or robot_type_keyLiteral robot type or source column.
timestamp_keyFrame-aligned timestamp column. If missing and fps is known, timestamps are generated from frame indices.
action_keyFrame-aligned action column.
state_keyOne state column or several columns concatenated as state.
extra_observation_keysAdditional observations exposed by name.
video_keysVideo columns exposed through row.videos.

Multiple state columns

pipeline = source.to_robot_rows(
    action_key="actions",
    state_key=("joint_pos", "joint_vel", "eef_pos", "gripper_qpos"),
)

Tuple state keys are concatenated into row.states and exposed as observation.state.

Nested frame data

If a row contains a nested frame table, pass nested_frames_key:

pipeline = source.to_robot_rows(
    nested_frames_key="frames",
    action_key="action",
    state_key="observation.state",
)

This is useful for custom readers that already group frames per episode. For RLDS-style rows, task_key can point into the nested frame data, such as task_key="steps/language_instruction".

Writing converted rows

Converted rows can be written as LeRobot:

pipeline.write_lerobot("hf://buckets/acme-robotics/converted-dataset")

See Writing LeRobot.