Skip to main content
The lerobot-replay command replays actions from a recorded episode on a physical robot.

Command

Location: src/lerobot/scripts/lerobot_replay.py

Overview

The replay script:
  • Loads episode data from a dataset
  • Executes recorded actions on the robot
  • Useful for verifying dataset quality
  • Tests robot hardware functionality
  • Demonstrates recorded behaviors

Key Options

Robot Configuration

str
required
Robot type: so100_follower, koch_follower, etc.
str
required
Serial port for robot connection (e.g., /dev/ttyUSB0).
str
required
Unique identifier for this robot instance.

Dataset Configuration

str
required
Dataset repository ID (e.g., myuser/my_dataset).
int
required
Episode index to replay (0-based).
str
Local path to dataset. Defaults to $HF_LEROBOT_HOME/{repo_id}.
int
default:"30"
Playback frames per second. Defaults to dataset fps.

Other Options

bool
default:"True"
Use vocal synthesis to announce events.

Usage Examples

Basic Replay

Replay from Local Dataset

Bimanual Robot Replay

Replay at Different Speed

Replay without Sound

Workflow

  1. Load Dataset: Downloads or loads dataset from specified location
  2. Connect Robot: Establishes connection to robot hardware
  3. Filter Episode: Extracts actions for specified episode
  4. Replay Actions: Executes each action at specified FPS
  5. Disconnect: Safely disconnects from robot

Safety Considerations

  1. Clear Workspace: Ensure robot workspace is clear before replay
  2. Emergency Stop: Have emergency stop button accessible
  3. Speed: Start with slower FPS to verify behavior
  4. Observation: Monitor robot during replay
  5. Compatibility: Ensure robot configuration matches dataset

Programmatic Usage

Custom Replay Logic

Troubleshooting

Robot Not Moving

  • Verify robot is calibrated: lerobot-calibrate --robot.type=... --robot.port=...
  • Check robot connection and power
  • Verify episode contains valid actions
  • Check action names match robot configuration

Jerky Motion

  • Ensure --dataset.fps matches original recording FPS
  • Check for communication delays on serial port
  • Verify robot can achieve commanded positions

Episode Not Found

See Also