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(api): pass the calibrated jaw max offset value when we resetting instrument #15032

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

ahiuchingau
Copy link
Contributor

Overview

We really only need to calibrate the gripper's max jaw offset once every time we attach a new gripper. This means that when we call ot3api.reset(), which is pretty often because it's called by ot3api.stop(), we should just reuse the calibrated value so we don't see the jaw opening and closing all the time.

@ahiuchingau ahiuchingau requested a review from a team as a code owner April 26, 2024 21:33
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Okay but let's get some tests please.

@@ -330,6 +331,9 @@ def _reload_gripper(
new_config,
cal_offset,
attached_instr._gripper_id,
attached_instr._jaw_max_offset
if attached_instr.has_jaw_width_calibration
Copy link
Contributor

Choose a reason for hiding this comment

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

has_jaw_width_calibration just checks if _jaw_max_offset is not None
so we can just pass in _jaw_max_offset directly without checking.

@@ -51,6 +51,9 @@ def reset_gripper(self) -> None:
og_gripper.config,
load_gripper_calibration_offset(og_gripper.gripper_id),
og_gripper.gripper_id,
og_gripper._jaw_max_offset
if og_gripper.has_jaw_width_calibration
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

lgtm!

@ahiuchingau ahiuchingau merged commit f0d880a into edge Apr 29, 2024
20 checks passed
@ahiuchingau ahiuchingau deleted the fix_gripper-recalibrating-jaws-all-the-time branch April 29, 2024 21:16
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
…instrument (#15032)

<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview
We really only need to calibrate the gripper's max jaw offset once every
time we attach a new gripper. This means that when we call
`ot3api.reset()`, which is pretty often because it's called by
`ot3api.stop()`, we should just reuse the calibrated value so we don't
see the jaw opening and closing all the time.
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.

None yet

3 participants