lerobot-setup-motors command configures motor IDs and communication settings for supported robot arms and teleoperation devices.
Command
src/lerobot/scripts/lerobot_setup_motors.py
Overview
This script:- Sets unique motor IDs for each joint
- Configures baudrate for motor communication
- Verifies motor connectivity
- Must be run before first use of a robot
Supported Devices
Compatible robots and teleoperators:koch_follower/koch_leaderomx_follower/omx_leaderopenarm_miniso100_follower/so100_leaderso101_follower/so101_leaderlekiwi
Key Options
Robot type to configure (use OR
--teleop.type, not both).Serial port for robot connection.
Teleoperator type to configure (use OR
--robot.type, not both).Serial port for teleoperator connection.
Usage Examples
Setup SO-100 Follower Robot
Setup SO-100 Leader (Teleoperator)
Setup Koch Robot
Setup OMX Leader
Setup OpenArm Mini
What It Does
The setup process varies by device type but typically includes:Motor ID Assignment
- Assigns unique IDs to each motor in the chain
- IDs typically start at 1 and increment sequentially
- Example: shoulder_pan=1, shoulder_lift=2, elbow=3, etc.
Baudrate Configuration
- Sets communication speed between controller and motors
- Common baudrates: 1000000 (1 Mbps), 3000000 (3 Mbps)
- Higher baudrate = faster communication, less latency
Motor Discovery
- Scans for connected motors
- Verifies each motor responds
- Reports any missing or unresponsive motors
Parameter Writing
- Writes configuration to motor EEPROM
- Settings persist across power cycles
- May include:
- Motor ID
- Baudrate
- Return delay time
- Status return level
Setup Workflow
-
Connect Hardware
- Plug in robot or teleoperator via USB
- Ensure device is powered on
-
Find Port
-
Run Setup
-
Follow Prompts
- Script may ask you to position motors
- Follow on-screen instructions
- Don’t disconnect during setup
-
Verify
- Script confirms successful configuration
- Test motors with teleoperation:
When to Run Setup
Run motor setup when:- First Time: New robot or teleoperator
- After Motor Replacement: Replaced any motors
- Communication Issues: Motors not responding
- ID Conflicts: Multiple motors with same ID
- Factory Reset: Motors reset to default settings
Troubleshooting
Port Permission Errors
No Motors Found
Causes:- Wrong port selected
- Motors not powered
- Faulty USB cable
- Incorrect baudrate
Motor ID Conflicts
If motors have duplicate IDs:- Isolate Motors: Connect one motor at a time
- Assign Unique IDs: Run setup for each motor individually
- Reconnect All: After all motors have unique IDs
- Verify: Run setup again to confirm
Setup Fails Partway
- Don’t disconnect USB during setup
- Ensure stable power supply to motors
- Avoid moving motors during configuration
- Check motor temperatures (overheating can cause issues)
Wrong Device Type
Error:- Verify device type is in supported list
- Check you’re using the correct
--robot.typeor--teleop.type - Some devices may not support automatic setup
Advanced Usage
Programmatic Setup
Teleoperator Setup
Configuration Files
You can also use a configuration file:Best Practices
- Label Ports: Mark which USB port connects to which device
- Document IDs: Record motor IDs for future reference
- Test After Setup: Always verify with teleoperation
- Backup Settings: Some devices allow exporting motor configurations
- Regular Checks: Re-run setup if motors behave unexpectedly
See Also
- lerobot-find-port - Identify USB ports
- lerobot-calibrate - Calibrate motor positions
- lerobot-teleoperate - Test motor setup
- Robot API - Robot control interface