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

fix(calibrate): fix calibrate arms option type. should be str not int #418

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

jackvial
Copy link
Contributor

@jackvial jackvial commented Sep 6, 2024

What this does

Fixes calibrate arms option type. should be str not int.

Was getting the following error when pass --arms option to calibrate

(venv) jack@jackml:~/code/rl/lerobot (jv/fix-control-robot-ams-type)$ python lerobot/scripts/control_robot.py calibrate --robot-path lerobot/configs/robot/koch_jack.yaml --robot-overrides '~cameras' --arms main_follower main_leader
usage: control_robot.py calibrate [-h] [--robot-path ROBOT_PATH] [--robot-overrides [ROBOT_OVERRIDES ...]]
                                  [--arms [ARMS ...]]
control_robot.py calibrate: error: argument --arms: invalid int value: 'main_follower'

How it was tested

Ran calibrate and confirmed I was no longer getting the error and that calibration succeeded. Further confirmed that teleoperation was working as expected after calibration.

Here's the calibrate output after fixing --arms type

(venv) jack@jackml:~/code/rl/lerobot (jv/fix-control-robot-ams-type)$ python lerobot/scripts/control_robot.py calibrate --robot-path lerobot/configs/robot/koch_jack.yaml --robot-overrides '~cameras' --arms main_follower main_leader
Removing '.cache/calibration/koch/main_follower.json'
Removing '.cache/calibration/koch/main_leader.json'
Connecting main follower arm.
Connecting main leader arm.
Missing calibration file '.cache/calibration/koch/main_follower.json'

Running calibration of koch main follower...

Move arm to zero position
See: https://raw.githubusercontent.com/huggingface/lerobot/main/media/koch/follower_zero.webp
Press Enter to continue...

Move arm to rotated target position
See: https://raw.githubusercontent.com/huggingface/lerobot/main/media/koch/follower_rotated.webp
Press Enter to continue...

Move arm to rest position
See: https://raw.githubusercontent.com/huggingface/lerobot/main/media/koch/follower_rest.webp
Press Enter to continue...

Calibration is done! Saving calibration file '.cache/calibration/koch/main_follower.json'
Missing calibration file '.cache/calibration/koch/main_leader.json'

Running calibration of koch main leader...

Move arm to zero position
See: https://raw.githubusercontent.com/huggingface/lerobot/main/media/koch/leader_zero.webp
Press Enter to continue...

Move arm to rotated target position
See: https://raw.githubusercontent.com/huggingface/lerobot/main/media/koch/leader_rotated.webp
Press Enter to continue...

Move arm to rest position
See: https://raw.githubusercontent.com/huggingface/lerobot/main/media/koch/leader_rest.webp
Press Enter to continue...

Calibration is done! Saving calibration file '.cache/calibration/koch/main_leader.json'
Activating torque on main follower arm.
Calibration is done! You can now teleoperate and record datasets!

How to checkout & try? (for the reviewer)

python lerobot/scripts/control_robot.py calibrate --robot-path lerobot/configs/robot/koch.yaml --robot-overrides '~cameras' --arms main_follower main_leader

Copy link
Collaborator

@Cadene Cadene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very helpful thanks!
We are in the process of adding more unit tests.

@Cadene Cadene merged commit b0b8612 into huggingface:main Sep 6, 2024
6 checks passed
@jackvial
Copy link
Contributor Author

jackvial commented Sep 7, 2024

Very helpful thanks! We are in the process of adding more unit tests.

Happy yo help! I see there are some tests for this in control robot test, but test with the requires_robot decorator are skipped. Curious if you plan to mock hardware components or have the tests run against real hardware?

@Cadene
Copy link
Collaborator

Cadene commented Sep 7, 2024

Yes! @jackvial
#398

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

Successfully merging this pull request may close these issues.

2 participants