lerobot-replay command replays actions from a recorded episode on a physical robot.
Command
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
- Load Dataset: Downloads or loads dataset from specified location
- Connect Robot: Establishes connection to robot hardware
- Filter Episode: Extracts actions for specified episode
- Replay Actions: Executes each action at specified FPS
- Disconnect: Safely disconnects from robot
Safety Considerations
- Clear Workspace: Ensure robot workspace is clear before replay
- Emergency Stop: Have emergency stop button accessible
- Speed: Start with slower FPS to verify behavior
- Observation: Monitor robot during replay
- 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.fpsmatches original recording FPS - Check for communication delays on serial port
- Verify robot can achieve commanded positions
Episode Not Found
See Also
- lerobot-record - Record episodes
- lerobot-teleoperate - Test teleoperation
- LeRobotDataset - Dataset format
- Robot API - Robot interface