Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First call to leader_arm.connect() does nothing, then manual motor configuration breaks #574

Open
1 of 2 tasks
trevormcinroe opened this issue Dec 13, 2024 · 2 comments
Open
1 of 2 tasks

Comments

@trevormcinroe
Copy link

System Info

- `lerobot` version: 0.1.0
- Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.27
- Python version: 3.11.11
- Huggingface_hub version: 0.26.5
- Dataset version: 3.2.0
- Numpy version: 1.26.4
- PyTorch version (GPU?): 2.5.1+cu118 (True)
- Cuda version: 11080
- Using GPU in script?: No

Information

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

Reproduction

I am following the instructions in https://github.com/huggingface/lerobot/blob/main/examples/7_get_started_with_real_robot.md

I connect my robots for the first time and run the following script:

from lerobot.common.robot_devices.motors.dynamixel import DynamixelMotorsBus

leader_port = "/dev/tty.usbmodem575E0031751"
follower_port = "/dev/tty.usbmodem575E0032081"

leader_arm = DynamixelMotorsBus(
    port=leader_port,
    ...

leader_arm.connect()

The instructions and linked video show that the follow error should pop up during the first connection:

/!\ A configuration issue has been detected with your motors:
If this is the first time you are using these motors, press enter to configure your motors...
...

However, on my run, this motor configuration process does not appear. Something is clearly wrong, as this code errors out: leader_arm.read("Present_Position")

So, I try to manually configure the motors with the following command, which produces the error Error occurred during motor configuration: 'Lock':

python3 lerobot/scripts/configure_motor.py --port /dev/ttyACM0 --brand dynamixel --model xl330-m077 --ID 1 --baudrate 57600Connected on port /dev/ttyACM0
Scanning all baudrates and motor indices
Setting bus baud rate to 9600. Previously 1000000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 10.71it/s]
Setting bus baud rate to 57600. Previously 9600.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 15.35it/s]
Setting bus baud rate to 1000000. Previously 57600.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.58it/s]
Setting bus baud rate to 2000000. Previously 1000000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.60it/s]
Setting bus baud rate to 115200. Previously 2000000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.19it/s]
Setting bus baud rate to 3000000. Previously 115200.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.61it/s]
Setting bus baud rate to 4000000. Previously 3000000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.62it/s]
Motor index found at: 1
Setting its baudrate to 57600
Setting bus baud rate to 57600. Previously 4000000.
Setting its index to desired index 1
Error occurred during motor configuration: 'Lock'
Disconnected from motor bus.

How exactly do I proceed to set up the robots? I have viewed the motor in the Dynamixel Wizard. All appears fine, and I can successfully ping the motor through this process.

Expected behavior

The expected motor-calibration process.

@trevormcinroe
Copy link
Author

The error occurs due to this line: https://github.com/huggingface/lerobot/blob/main/lerobot/scripts/configure_motor.py#L105

because the key "Lock" is not within DynamixelMotorBus.model_ctrl_table here: https://github.com/huggingface/lerobot/blob/main/lerobot/common/robot_devices/motors/dynamixel.py#L764

@trevormcinroe
Copy link
Author

For those in a similar spot:

I got around the issue by not using the provided code to configure the motors. Instead, I used Dynamixels official software to manually set the motor ids and the baudrates: https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/#software-installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant