fix: replace the default factory calibration with measured values - #12
Merged
Merged
Conversation
The factory file is the last entry of the automatic load chain, so its numbers are what a unit runs on before it is calibrated on site. The shipped values were nominal for a 120 mm stroke unit (1.605 rad x 74.8 mm/rad); this unit travels 86.0 mm over 1.409552 rad, which is 61.0123 mm/rad. The two limits keep their ordering, so the fallback stays a normal mount and the direction the templates guard against is unchanged. The file also carries kp 5.0 where it carried 100.0, and load_calibration applies that field to GripperConfig, so the fallback path now commands a softer grip.
|
🎉 This PR is included in version 0.5.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
src/litegrip/factory_calibration.jsonis the last entry of the automatic loadchain, so it is what an uncalibrated unit runs on. Its numbers were nominal for a
120 mm stroke unit (
1.605 rad × 74.8 mm/rad); the measured unit travels 86.0 mmover
1.409552 rad. This replaces the file with the measured values.Two things a reviewer should see before merging:
built-in fallback gets a different stroke (120 mm → 86.0 mm) and a different
rad_to_mm(74.8→61.01229326764816) without changing their code. Under theversion policy this ships as a patch (
fix:), not a major — noBREAKING CHANGE:was approved. Say so now if it should be a major.
kpdrops from100.0to5.0. The field is carried by the file andload_calibration()applies it toGripperConfig, so it overridesGripperParams.DEFAULT_KPon the fallback path — a 20× softer grip. If5.0isa value measured for one bench setup rather than the shipped default, drop that
line before merging.
Changes
src/litegrip/factory_calibration.json:zero_position_rad0.114→0.052071,max_position_rad-1.491→-1.357481,travel_range_rad1.605→1.409552,rad_to_mm74.8→61.01229326764816,kp100.0→5.0.channel,can_id,mst_id,canfd_mode,motor_type,kd,grasp_torque_threshold) is unchanged.mount without quoting its numbers, and the ordering of the limits still makes it a
normal mount (
0.052071 > -1.357481), somountstill reads"normal"and thetemplate fallback guard still holds.
Testing
Baseline before the change, and again after it — same result:
Loaded the new file directly to confirm the derived values:
mount = normal,pos_closed_rad = 0.052071,pos_open_rad = -1.357481,rad_to_mm = 61.01229326764816,kp, kd = 5.0 2.0,calibrated = True,stroke_mm = 86.0.The data is internally consistent:
1.409552 × 61.01229326764816 = 86.0000, whichmatches
travel_range_radand the two limits (0.052071 - (-1.357481) = 1.409552).Issues
None.