feat(motors): allow per-motor setup and calibration for SO leader/follower#3499
Open
eliasab16 wants to merge 8 commits intohuggingface:mainfrom
Open
feat(motors): allow per-motor setup and calibration for SO leader/follower#3499eliasab16 wants to merge 8 commits intohuggingface:mainfrom
eliasab16 wants to merge 8 commits intohuggingface:mainfrom
Conversation
pre-commit run --files $(git ls-files src/lerobot/robots)
pytest tests/robots/test_so101_follower.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / Motivation
Adds a --motors flag that acceps a comma separated list of motor names to lerobot-setup-motors and lerobot-calibrate modules so users can recalibrate or re-register a single motor (or a subset) without redoing the full sequence. Useful when replacing a single servo or correcting drift on one joint without disturbing the rest of the calibration.
Examples:
What changed
How was this tested (or how to run locally)
pytest tests/motors/test_calibration.py -vpre-commit run --all-filesChecklist (required before merge)
pre-commit run -a)pytest)Reviewer notes
Regarding point (1) in the "what changed" section: at first I followed the existing structure by adding the same partial calibration function to both the follower and leader files separately. But then decided to just create a new file 'calibration.py' under motors/feetech and created the partial calibration as a shared method. The obvious reasons are to reduce redundancy in both the main files and the tests and improve maintainability. However if there are good reasons why we should keep separate methods in both the so_leader.py and so_follower.py, I can change that. But if this approach is accepted, then maybe we should consider moving more of the calibration logic to the new 'calibration.py' file.
While the partial calibration function is generic and can be used for any feetech-based robot, I only integrated it into the so101 follower and leader files. If this diff is accepted and merged, I will extend it to the other robot files.