Skip to main content
rfx record collects demonstration episodes from a robot and saves them as a LeRobot-compatible dataset.

Basic Usage

rfx record --robot so101 --repo-id my-org/demos --episodes 10
This command:
  1. Connects to the robot hardware
  2. Records 10 demonstration episodes
  3. Saves them to datasets/my-org/demos/ as a LeRobot dataset
  4. Prints summary: episodes recorded, total frames, output path

Arguments

Required

--robot
string
required
Robot type to record from. Examples: so101, go2, g1
--repo-id
string
required
HuggingFace dataset repository ID. Can be username/dataset-name or just dataset-name for local-only.

Optional

--output
string
default:"datasets"
Output root directory where datasets are saved.
rfx record --robot so101 --repo-id demos --output ./my-datasets
--episodes
int
default:"1"
Number of episodes to record.
rfx record --robot so101 --repo-id demos --episodes 50
--duration
float
default:"None"
Maximum duration per episode in seconds. If not specified, each episode continues until manually stopped.
rfx record --robot so101 --repo-id demos --episodes 10 --duration 30
--task
string
default:"default"
Task label to attach to episodes. Useful for multi-task datasets.
rfx record --robot so101 --repo-id demos --task "pick_and_place"
--fps
int
default:"30"
Recording frame rate (frames per second).
rfx record --robot so101 --repo-id demos --fps 60
--push
boolean
default:"false"
Push dataset to HuggingFace Hub after collection completes.
rfx record --robot so101 --repo-id my-org/demos --episodes 10 --push
--mcap
boolean
default:"false"
Also log an MCAP sidecar file for replay and debugging.
rfx record --robot so101 --repo-id demos --mcap
--state-dim
int
default:"6"
State dimension override. Normally auto-detected from robot config.
rfx record --robot so101 --repo-id demos --state-dim 12

Examples

Record 10 episodes for SO-101 arm

rfx record --robot so101 --repo-id my-org/demos --episodes 10

Record and push to HuggingFace Hub

rfx record --robot so101 --repo-id my-org/pick-demos --episodes 20 --push

Record with 60 FPS and 30-second episodes

rfx record --robot so101 --repo-id demos --episodes 5 --duration 30 --fps 60

Record multi-task dataset with task labels

rfx record --robot so101 --repo-id demos --task "pick_cube" --episodes 10
rfx record --robot so101 --repo-id demos --task "stack_blocks" --episodes 10

Record with MCAP sidecar for debugging

rfx record --robot so101 --repo-id demos --episodes 5 --mcap

Output Format

Recorded datasets follow the LeRobot dataset structure:
datasets/my-org/demos/
├── data/
│   ├── chunk-000/
│   │   ├── observation.state.bin
│   │   ├── action.bin
│   │   └── ...
├── meta/
│   └── info.json
└── videos/
    └── ...
This format is compatible with:
  • LeRobot training pipelines
  • HuggingFace datasets library
  • rfx training tools

Stopping Recording

Press Ctrl+C to stop recording gracefully:
[rfx] Recording stopped.
[rfx] Recorded 3 episodes, 1842 frames
[rfx] Saved to datasets/demos

Output Information

After successful recording, rfx prints:
[rfx] Recorded 10 episodes, 4532 frames
[rfx] Saved to datasets/my-org/demos
  • episodes: Number of complete episodes recorded
  • frames: Total observation frames across all episodes
  • path: Location of the saved dataset

Python API

You can also record from Python:
import rfx

result = rfx.collection.collect(
    robot="so101",
    repo_id="my-org/demos",
    episodes=10,
    duration=30,
    fps=30,
    push=False,
)

print(f"Recorded {result['episodes']} episodes")
print(f"Saved to {result['root']}")

Troubleshooting

Robot not found

If the robot isn’t detected:
rfx doctor  # Check hardware detection

Permission denied on serial port

On Linux, add your user to the dialout group:
sudo usermod -aG dialout $USER
# Log out and back in

Low frame rate

If actual FPS is lower than requested:
  • Check USB connection quality
  • Reduce --fps value
  • Ensure robot firmware is up to date

See Also

Build docs developers (and LLMs) love