lerobot-calibrate command calibrates motors on robots and teleoperation devices to establish correct zero positions.
Command
src/lerobot/scripts/lerobot_calibrate.py
Overview
Calibration:- Establishes motor zero positions
- Corrects for mechanical offsets
- Required for accurate robot control
- Saves calibration data for future use
- Should be run when hardware changes
Key Options
Robot Calibration
str
Robot type to calibrate:
so100_follower, koch_follower, etc.str
Serial port for robot connection.
str
Unique identifier for robot.
Teleoperator Calibration
str
Teleoperator type to calibrate:
so100_leader, koch_leader, etc.str
Serial port for teleoperator.
str
Unique identifier for teleoperator.
Usage Examples
Calibrate Robot
Calibrate Teleoperator
Calibrate Koch Robot
Calibrate Bimanual Arms
Calibration Process
The calibration process varies by robot type:For SO-100 Arms
- Script connects to motors
- Prompts to move arm to calibration pose
- User manually positions arm
- Press Enter to capture calibration
- Calibration data saved to file
For Koch Arms
- Script connects to motors
- Motors move to home position automatically
- Reads and saves encoder offsets
- Calibration complete
Calibration Storage
Calibration files are saved to:When to Calibrate
Calibrate your device when:- First Setup: Initial hardware setup
- Motor Replacement: After replacing any motors
- Mechanical Changes: After adjusting mechanical linkages
- Poor Accuracy: When movements become inaccurate
- After Crashes: If robot experiences hard impacts
- Regular Maintenance: Periodically for best performance
Programmatic Usage
Manual Calibration
Load Existing Calibration
Troubleshooting
Calibration Not Saving
- Check file permissions in calibration directory
- Verify
robot.idis set correctly - Ensure calibration directory exists
Robot Behavior Still Incorrect
- Re-run calibration process
- Check mechanical assembly
- Verify motor connections
- Test individual motors
Port Permission Errors
Motors Not Responding
- Verify power connection
- Check serial cable connection
- Try different USB port
- Check motor IDs are configured correctly
Best Practices
- Consistent Pose: Use the same calibration pose each time
- Stable Surface: Calibrate on a stable, level surface
- Regular Checks: Verify calibration before important recordings
- Backup Calibration: Save copies of calibration files
- Document Pose: Take photos of calibration pose for reference
See Also
- lerobot-teleoperate - Test calibration
- lerobot-record - Record with calibrated devices
- Robot API - Robot calibration methods
- Robots Overview - Initial hardware setup