C401 Lesson 4: Training Formats
The last step of the pipeline writes what lessons 1 to 3 produced into files a data loader can read. This lesson covers the formats current egocentric releases use, with LeRobotDataset v3.0 in most detail because the lab exports to it. The full treatment is on Training Formats: LeRobot, RLDS and Friends.
Terms used in this lesson
Section titled “Terms used in this lesson”See also the glossary’s datasets and formats section.
| Term | Meaning |
|---|---|
| Episode | One continuous recording of a task from start to finish: a sequence of time-aligned observations and actions |
| Shard | One large file that packs many episodes, so storage handles fewer, larger files |
| Feature | A named per-frame field with a dtype and shape, such as observation.state or observation.images.<camera> |
observation.state |
A per-frame vector describing the agent: joint angles for a robot; wrist pose and finger joints for a human hand |
action |
The command or motion target at a timestep, absolute (a target pose) or relative (a delta) |
| MCAP | An open container for timestamped publish/subscribe messages with embedded schemas and an index |
Recording containers and training formats
Section titled “Recording containers and training formats”A recording container is built for capture: it appends time-stamped packets in arrival order. A training format is built for learning: it organises many episodes so a loader can sample random frames, slice short time windows and normalise states and actions without opening millions of small files (Training Formats).
Current public egocentric releases often ship both. Lightwheel publishes its datasets as MCAP and as LeRobot, and both cards warn: “LeRobot and MCAP are alternative representations of the same episodes and must not be counted as additional hours” (EgoStandard card).
LeRobotDataset v3.0
Section titled “LeRobotDataset v3.0”LeRobotDataset is Hugging Face’s dataset format for the lerobot library. States, actions and timestamps go in Parquet tables, camera frames in MP4, and metadata in JSON and Parquet. In v2.1 every episode had its own files; v3.0 concatenates many episodes into each file. The v3.0 docs explain: “To scale to millions of episodes, tabular rows and video frames from multiple episodes are concatenated into larger files.”
What to know before writing one (LeRobotDataset):
- The schema lives in
meta/info.json, with the feature names, dtypes and shapes, the frame rate and the path templates. Normalisation statistics live inmeta/stats.json. - Cameras are features named
observation.images.<camera>, with dtypevideo. - There is no field for camera intrinsics or extrinsics. Egocentric releases add their own files under
meta/; MundoAI’s sample puts “camera intrinsics + head-to-camera offset, keyed by device” in a calibration file there (MundoAI-Robotics-Sample). - Call
finalize(). v3.0 writes Parquet incrementally: “When creating or recording datasets, you must call dataset.finalize() to properly close parquet writers.” Without it the files are incomplete and the dataset will not load (v3.0 docs). - Timestamps come from the frame rate. In lerobot 0.7.0,
add_frame()computes each frame’s timestamp as its index divided by the dataset’s fps, and the caller must not supply one (dataset_writer.py). Frames you add must therefore be evenly spaced at that rate.
The other formats, and when they fit
Section titled “The other formats, and when they fit”| Downstream use | Export | Why |
|---|---|---|
| PyTorch imitation learning, VLA training, Hub release | LeRobotDataset v3.0 | Few large files; time windows, streaming and GPU augmentation built in |
| Inspection, curation, ROS 2 / Foxglove / FiftyOne | MCAP | Keeps native sensor rates, embedded schemas and calibration attachments |
| Dense per-frame skeletons, depth, SLAM | MP4 + HDF5, or Zarr | Video stays hardware-decodable; arrays stay in one indexed file or store |
| Video-only pretraining at 10,000+ hours | WebDataset | Sequential streaming of .tar shards with little metadata overhead |
The table is the field guide’s which format to export. MCAP keeps every stream at its own rate, where LeRobot flattens an episode into fixed-rate rows aligned to video frames (MCAP as a distribution and curation format). Several egocentric releases keep video as MP4 and put the kinematics in HDF5: EgoDex pairs each MP4 with an HDF5 file holding camera intrinsics and extrinsics and upper-body joint poses (HDF5 layouts).
Human data as states and actions
Section titled “Human data as states and actions”In a teleoperated robot dataset, state and action come from the robot. Human capture has no robot. As RoboX’s card puts it: “No robot retargeting is applied. target_embodiment is null and no robot telemetry is present” (RoboX lerobot-dataset). Pipelines build proxy states and actions from hand pose, world-space hand tracking and SLAM head poses. Three details recur in the published schemas (representing human egocentric data):
- Remove head motion from hand actions. Hand poses from a head camera are in a moving frame. EgoMimic and EgoVerse use the SLAM poses to express every future hand pose in the camera frame at the current time.
- Do not subtract quaternions. RoboX’s action uses “a 3-D relative rotation vector rotvec(q[t+1] . inverse(q[t])) rather than a quaternion subtraction”, and it excludes the quaternion indices from mean/std normalisation, which would break their unit norm.
- Match human and robot speed. People move faster than teleoperated robots, so a chunk of fixed length would cover more of the task in human data than in robot data. EgoVerse resamples a 1-second human window and a 1.5-second robot window to 100 steps each, and normalises each embodiment separately (Matching human and robot speed).
Turning these into robot policies is course C402. For this course, the rule is simpler: whatever you export, write down which frame each pose is in, its units, and its rotation convention.
Self-check
Section titled “Self-check”- You record a ROS 2 bag with images at 30 Hz and an IMU at 200 Hz. Why might you ship MCAP alongside a LeRobot export?
- Your conversion script runs without errors, but the dataset will not load. What is the first thing to check in a v3.0 export?
- Where do the camera intrinsics go in a LeRobotDataset?
- Your tracker produced no pose for 40 frames in the middle of an episode. Why can you not simply skip them when calling
add_frame()? - Why does RoboX exclude its quaternion components from mean/std normalisation?
Answers
Section titled “Answers”- LeRobot flattens an episode into fixed-rate rows aligned to video frames; MCAP keeps every stream at its own rate, with embedded schemas, for inspection and curation. If you ship both, say on the card that they are the same episodes.
- Whether
finalize()was called after the lastsave_episode(); without it the Parquet files are incomplete. - There is no standard field. Add a file under
meta/, as egocentric releases do, and describe it on the card. - lerobot computes timestamps from the frame index and fps, so skipped frames would shift every later frame’s timestamp. End the episode at the gap or fill it by a documented method.
- Mean/std scaling would break a quaternion’s unit norm.
Sources
Section titled “Sources”- Field guide: Training Formats: LeRobot, RLDS and Friends, Recording Containers: VRS, MCAP and GPMF, glossary.
- Hugging Face: LeRobotDataset v3.0 docs; lerobot v0.7.0
dataset_writer.py(Apache-2.0). - Dataset cards: LightwheelAI/EgoStandard, MundoAI-Robotics-Sample, RoboXTechnologies/lerobot-dataset.
- EgoVerse (2026). arXiv.
- Kareer et al. (2024). EgoMimic. arXiv.
- Hoque et al. (2025). EgoDex. arXiv.