Skip to main content
The 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

Location: 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

str
required
Robot type (e.g., so100_follower, koch_follower).
str
required
Serial port for robot connection.
str
required
Unique robot identifier.

Teleoperator Configuration

str
required
Teleoperator type (e.g., so100_leader, koch_leader).
str
required
Serial port for teleoperator.
str
required
Unique teleoperator identifier.

Kinematics Configuration

str
required
Path to robot URDF file for forward kinematics.
str
default:"gripper"
End-effector frame name in URDF.

Recording Configuration

float
default:"30"
Duration of recording phase in seconds.
float
default:"5"
Duration of warmup phase in seconds.
int
default:"30"
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:
During warmup:
  • Test teleoperation control
  • Verify robot responds correctly
  • Check for any connectivity issues
  • Data is not recorded

2. Recording Phase

Script output:
During recording:
  • 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
Workspace volume:
  • X range: min_ee[0] to max_ee[0]
  • Y range: min_ee[1] to max_ee[1]
  • Z range: min_ee[2] to max_ee[2]

Joint Position Limits

Format: Radians for each joint
For a 6-DOF arm:
  • Index 0: Shoulder pan
  • Index 1: Shoulder lift
  • Index 2: Elbow flex
  • Index 3: Wrist flex
  • Index 4: Wrist roll
  • Index 5: Gripper
Convert to degrees:

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

  1. Move slowly: Avoid sudden movements that might miss limits
  2. Test each joint: Move one joint at a time to extremes
  3. Explore workspace: Move end-effector to corners and edges
  4. Multiple passes: Go through the range twice to confirm limits
  5. Use full time: Don’t rush; use the full teleop_time_s

Safety

  1. Check workspace: Ensure clear area around robot
  2. Emergency stop: Know how to stop the robot
  3. Start slow: Use warmup to verify control
  4. Watch temperatures: Monitor for overheating
  5. 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
Custom robots:
  • Ensure URDF matches physical robot
  • Verify joint names and frame definitions
  • Test forward kinematics accuracy

Troubleshooting

Kinematics Initialization Failed

Error:
Solutions:
  • Check --urdf_path points to valid file
  • Verify --target_frame_name exists 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-teleoperate first

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