fix: calibration workflow when using robot_id with existing calibration files#1528
Merged
imstevenpmwork merged 5 commits intomainfrom Jul 20, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the calibration workflow by allowing use of existing calibration files via an interactive prompt and by passing calibration data through connect() into calibrate().
- Adds a
calibrationparameter tocalibrate()across leader and follower classes - Prompts user to choose between existing calibration file or fresh calibration
- Updates
connect()to forward loaded calibration data
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lerobot/teleoperators/so101_leader/so101_leader.py | Updated connect() and calibrate() signature, added interactive prompt logic |
| src/lerobot/teleoperators/so100_leader/so100_leader.py | Same calibration-parameter and prompt changes as above |
| src/lerobot/teleoperators/koch_leader/koch_leader.py | Same calibration-parameter and prompt changes as above |
| src/lerobot/robots/so101_follower/so101_follower.py | Added calibration param to follower connect() and interactive prompt in calibrate() |
| src/lerobot/robots/so100_follower/so100_follower.py | Added calibration param to follower connect() and interactive prompt in calibrate() |
| src/lerobot/robots/lekiwi/lekiwi.py | Added calibration param to connect() and interactive prompt in calibrate() |
| src/lerobot/robots/koch_follower/koch_follower.py | Added calibration param to follower connect() and interactive prompt in calibrate() |
| src/lerobot/robots/bi_so100_follower/bi_so100_follower.py | Updated calibrate() to forward child arms’ calibration parameters |
Comments suppressed due to low confidence (3)
src/lerobot/teleoperators/so101_leader/so101_leader.py:87
- [nitpick] This log message may be misleading since no mismatch is actually verified before prompting. Consider changing it to something like "Calibration file provided for robot id {self.id}" to accurately reflect the condition.
logging.info("Mismatch between calibration values in the motor and the calibration file")
src/lerobot/teleoperators/so101_leader/so101_leader.py:85
- [nitpick] The parameter name
calibrationshadows the instance attribute and may cause confusion. Consider renaming it to something likeprovided_calibration.
def calibrate(self, calibration: dict[str, MotorCalibration] | None = None) -> None:
src/lerobot/teleoperators/so101_leader/so101_leader.py:89
- Add unit tests (with input mocking) to verify both branches of the interactive prompt — using the provided calibration file and running a fresh calibration — to prevent regressions.
user_input = input(
…ity for bi_so100_leader
…s in multiple robot classes
imstevenpmwork
requested changes
Jul 18, 2025
AdilZouitine
added a commit
that referenced
this pull request
Aug 10, 2025
milong26
pushed a commit
to milong26/lerobot_diy
that referenced
this pull request
Aug 26, 2025
Ricci084
pushed a commit
to JeffWang987/lerobot
that referenced
this pull request
Sep 5, 2025
BillmanH
pushed a commit
to BillmanH/lerobot
that referenced
this pull request
Sep 7, 2025
sandhya-cb
pushed a commit
to sandhya-cb/lerobot-clutterbot
that referenced
this pull request
Jan 28, 2026
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.
What this does
This PR improves the calibration workflow when users provide a
robot_idthat has an associated calibration file. Previously, if there was a mismatch between the calibration values stored in the motors and those in the calibration file, users were forced to recalibrate from scratch. This was problematic in scenarios where:Changes
calibrationparameter to thecalibrate()method across all robot and teleoperator classesrobot_idconnect()method calls to pass the loaded calibration to thecalibrate()methodAffected Classes
Follower Robots:
KochFollowerLeKiwiSO100FollowerSO101FollowerBiSO100FollowerLeader Teleoperators:
KochLeaderSO100LeaderSO101LeaderBiSO100LeaderBenefits
This change ensures that users who have already calibrated their robots can quickly restore their calibration settings without going through the entire calibration process again.