lerobot-find-joint-limits command helps you determine the physical limits of robot joints and end-effector workspace by moving the robot through its full range of motion during teleoperation.
Command
src/lerobot/scripts/lerobot_find_joint_limits.py
Overview
This script:- Records joint positions during teleoperation
- Computes min/max limits for each joint
- Calculates end-effector (x, y, z) workspace bounds
- Uses forward kinematics from URDF
- Outputs limits in radians and meters
- Includes warmup phase for safe operation
Key Options
Robot Configuration
Robot type (e.g.,
so100_follower, koch_follower).Serial port for robot connection.
Unique robot identifier.
Teleoperator Configuration
Teleoperator type (e.g.,
so100_leader, koch_leader).Serial port for teleoperator.
Unique teleoperator identifier.
Kinematics Configuration
Path to robot URDF file for forward kinematics.
End-effector frame name in URDF.
Recording Configuration
Duration of recording phase in seconds.
Duration of warmup phase in seconds.
Control loop frequency in Hz.
Usage Examples
Find Limits for SO-100 Robot
Find Limits for Koch Robot
Quick Test with Short Recording
Workflow
1. Warmup Phase
Script output:- Test teleoperation control
- Verify robot responds correctly
- Check for any connectivity issues
- Data is not recorded
2. Recording Phase
Script output:- Move each joint to its minimum position
- Move each joint to its maximum position
- Explore full workspace
- Cover all reachable positions
- Script tracks min/max values
3. Results Output
Script output:Understanding the Results
End Effector Bounds
Format:[x, y, z] in meters
- x: Forward/backward extent
- y: Left/right extent
- z: Up/down extent
- X range:
min_ee[0]tomax_ee[0] - Y range:
min_ee[1]tomax_ee[1] - Z range:
min_ee[2]tomax_ee[2]
Joint Position Limits
Format: Radians for each joint- Index 0: Shoulder pan
- Index 1: Shoulder lift
- Index 2: Elbow flex
- Index 3: Wrist flex
- Index 4: Wrist roll
- Index 5: Gripper
Using the Results
Validate Joint Limits
Compare discovered limits to URDF or specification:Configure Workspace Bounds
Use end-effector bounds for task planning:Update Robot Configuration
Add limits to robot config:Best Practices
Thorough Exploration
- Move slowly: Avoid sudden movements that might miss limits
- Test each joint: Move one joint at a time to extremes
- Explore workspace: Move end-effector to corners and edges
- Multiple passes: Go through the range twice to confirm limits
- Use full time: Don’t rush; use the full
teleop_time_s
Safety
- Check workspace: Ensure clear area around robot
- Emergency stop: Know how to stop the robot
- Start slow: Use warmup to verify control
- Watch temperatures: Monitor for overheating
- Add margins: Use discovered limits minus safety margin
URDF Selection
SO-100/SO-101 robots:- Use official URDF from SO-ARM100 repo
- Recommended:
Simulation/SO101/so101_new_calib.urdf - Contains accurate kinematic parameters
- Ensure URDF matches physical robot
- Verify joint names and frame definitions
- Test forward kinematics accuracy
Troubleshooting
Kinematics Initialization Failed
Error:- Check
--urdf_pathpoints to valid file - Verify
--target_frame_nameexists in URDF - Test URDF in simulation first
- Check URDF syntax is valid
Robot Not Moving
During warmup:- Verify robot and teleop are connected
- Check ports are correct
- Ensure devices are calibrated
- Test with
lerobot-teleoperatefirst
Incomplete Coverage
If limits seem too narrow:- Increase
--teleop_time_s(e.g., 60-120 seconds) - Move more systematically through workspace
- Test individual joints separately
- Run multiple sessions and combine results
Port Connection Errors
See lerobot-find-port for port identification.Advanced Usage
Multiple Recording Sessions
Combine results from multiple runs:See Also
- lerobot-calibrate - Calibrate motor positions
- lerobot-teleoperate - Test robot control
- Robot Control - Robot control concepts
- SO-ARM100 Repository - URDF files