lerobot icon indicating copy to clipboard operation
lerobot copied to clipboard

Calibration parameters are not written to motors

Open Kracozebr opened this issue 7 months ago • 5 comments

System Info

OS Ubuntu 24.04
Python                   3.10.13
lerobot                  0.1.0 
numpy                    2.2.6
torch                    2.7.1
I have assembly the SO-101 arms the follower and the leader.
My servo in arm are Feetech STS 3215 6.4V for leader and 12V follower.

Information

  • [x] One of the scripts in the examples/ folder of LeRobot
  • [ ] My own task or dataset (give details below)

Reproduction

Steps to reproduce behavior:

  1. Calibrate the follower:
python -m lerobot.calibrate \
    --robot.type=so101_follower \
    --robot.port=/dev/ttyACM0 \
    --robot.id=follower
  1. Calibrate the leader:
python -m lerobot.calibrate \
    --teleop.type=so101_leader \
    --teleop.port=/dev/ttyACM1 \
    --teleop.id=leader
  1. Run teleoperate script:
python -m lerobot.teleoperate \
    --robot.type=so101_follower \
    --robot.port=/dev/ttyACM0 \
    --robot.id=follower \
    --teleop.type=so101_leader \
    --teleop.port=/dev/ttyACM1 \
    --teleop.id=leader
  1. First run is ok, but if I press Ctrl+c and rerun teleoperate then I need to calibrate the arm once again.
  2. As I know the calibration is performed in 2 cases. First is there is no written calibration config json file but I've checked it is written:
/home/John/.cache/huggingface/lerobot/calibration/robots/so101_follower/follower.json
/home/John/.cache/huggingface/lerobot/calibration/teleoperators/so101_leader/leader.json

The over case is that calibration parameters from config and motor registers do not match. So I've checked and discover the strange behavior. In some motors in calibration files there are negative numbers, for example:

    "shoulder_lift": {
        "id": 2,
        "drive_mode": 0,
        "homing_offset": -1732,
        "range_min": 1499,
        "range_max": 3853
    }

homing_offset is negative and at this negative numbers the register parameter Position Offset Value is incorrect. When I try to set manually it puts large positive number like 65353 (I think this is due to this parameter has uint16 Format or smth like that)

Expected behavior

The calibration parameters are written to motors registers and there is no need to calibrate arms each time one runs the teleoperate script.

Kracozebr avatar Jun 17 '25 19:06 Kracozebr

STSCL\CalibrationOfs: The demo used to set the center position of the servo. After calling the following function, the current position of the servo will be used as the center position of the servo.

This only sets the center position- I dont see any other UART methods for writing min/max values

matbeedotcom avatar Jun 17 '25 21:06 matbeedotcom

I am facing the same issue and I do not know how to do from now ? Teleoperation is not working because it asks again and again to calibrate

FaboNo avatar Jun 18 '25 17:06 FaboNo

STSCL\CalibrationOfs: The demo used to set the center position of the servo. After calling the following function, the current position of the servo will be used as the center position of the servo.

This only sets the center position- I dont see any other UART methods for writing min/max values

Sorry not fully understand your comment.

Kracozebr avatar Jun 19 '25 06:06 Kracozebr

I am facing the same issue and I do not know how to do from now ? Teleoperation is not working because it asks again and again to calibrate

What hardware setup do you have? May be this is due to inappropriate motor model

Kracozebr avatar Jun 19 '25 06:06 Kracozebr

@Kracozebr I am using a kit with the STS3215 servos. I try to dig in the software to understand what is going on

FaboNo avatar Jun 19 '25 11:06 FaboNo

does the calibrate.py file work for you guys? as i am not doing the leader arm it seems that there arent enough arguments for the file to run

ramallis avatar Jun 27 '25 20:06 ramallis