huggingface / lerobot

🤗 LeRobot: Making AI for Robotics more accessible with end-to-end learning
Apache License 2.0
7.62k stars 726 forks source link

`configure_motor.py --keep-id`: allow reconfiguring a motor without changing its id #507

Open alsuren opened 1 week ago

alsuren commented 1 week ago

This allowed me to configure an already-configured robot.

What this does

Explain what this PR does. Feel free to tag your PR with the appropriate label(s).

one of my servos was attached in a strange orientation and without its offset configured correctly (I put the thing together before configure_motor.py existed, by hand-rolling some python against the sdk code from their wiki), so I had to hack configure_motor.py to allow me to re-calibrate the motor without changing its id

-- https://discord.com/channels/1216765309076115607/1237741463832363039/1307375596975951923

With this patch applied, you can do:

python lerobot/scripts/configure_motor.py   --port /dev/tty.usbmodem58A60701511   --brand feetech   --model sts3215   --baudrate 1000000 --keep-id  --ID 2
Title Label
Makes it easier to quickly reconfigure motors on an already assembled robot (📎 Paper Cut)

How it was tested

Explain/show how you tested your changes.

Manually tested using:

python lerobot/scripts/configure_motor.py   --port /dev/tty.usbmodem58A60701511   --brand feetech   --model sts3215   --baudrate 1000000 --keep-id  --ID 2

This did not require me to unplug any servos. It rotated the servo to somewhere that it thought was central, but wasn't. I then unscrewed the servo horn screws and ran it again, then re-connected the arm in the correct position.

How to checkout & try? (for the reviewer)

Provide a simple way for the reviewer to try out your changes.

On an already calibrated and connected robot, run:

python lerobot/scripts/configure_motor.py   --port /dev/tty.usbmodem58A60701511   --brand feetech   --model sts3215   --baudrate 1000000 --keep-id  --ID 6

It should twich open the gripper.