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

refactor(api): ot3: add gripper critical points #11024

Merged
merged 11 commits into from
Jul 8, 2022

Conversation

sfoster1
Copy link
Member

@sfoster1 sfoster1 commented Jul 6, 2022

For now, add some gripper-specific critical points to the enum that the
gripper handles, and use them to calculate position offsets for motion.
JAW_CENTER is the default, and will be what gets used in most calls when
a gripper is present; the calibration points will be used for calibration.

These new critical points will cause an error if used with pipettes, and the pipette critical points will cause an error if used with the gripper.

It's no longer valid to move the mount critical point for the gripper, since that criticalpoint is attached directly to the carriage.

These values are tested on a proto build.

@sfoster1 sfoster1 requested review from a team July 6, 2022 19:01
@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #11024 (21b6c37) into edge (62e9c9b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #11024   +/-   ##
=======================================
  Coverage   73.78%   73.78%           
=======================================
  Files        2076     2076           
  Lines       57309    57332   +23     
  Branches     5726     5731    +5     
=======================================
+ Hits        42283    42304   +21     
- Misses      13788    13790    +2     
  Partials     1238     1238           
Flag Coverage Δ
app 70.89% <ø> (+0.03%) ⬆️
notify-server 89.17% <ø> (ø)
protocol-designer 46.02% <ø> (ø)
shared-data 86.04% <ø> (ø)
step-generation 89.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/src/opentrons/config/defaults_ot3.py 87.27% <100.00%> (ø)
api/src/opentrons/hardware_control/ot3api.py 80.66% <100.00%> (ø)
api/src/opentrons/hardware_control/types.py 96.51% <100.00%> (ø)
...colRun/SetupLiquids/LiquidsLabwareDetailsModal.tsx 86.36% <0.00%> (-8.09%) ⬇️
...ices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx 81.81% <0.00%> (+1.81%) ⬆️
...rganisms/Devices/ProtocolRun/SetupLiquids/utils.ts 93.05% <0.00%> (+2.31%) ⬆️

@sfoster1 sfoster1 force-pushed the RET-1091-no-more-required-enalbe branch from 849e971 to 6eea14c Compare July 6, 2022 20:22
Base automatically changed from RET-1091-no-more-required-enalbe to edge July 6, 2022 21:13
@sfoster1 sfoster1 force-pushed the RET-1019-gripper-critical-points branch 2 times, most recently from 573fcb2 to f3633c6 Compare July 7, 2022 16:16
@sfoster1 sfoster1 marked this pull request as ready for review July 7, 2022 16:16
@sfoster1 sfoster1 requested review from a team as code owners July 7, 2022 16:17
Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

Initial thoughts about naming for offsets. We can push these decisions to later as well, or to a wider group but if we're only ever using one pin to calibrate then we should think about reducing the number of sensors as well as only have 1 pin available to add to the gripper in the mechanical design -- otherwise I could see it getting confusing for users.

self._jaw_center_offset = (
Point(*self._config.jaw_center_offset_from_base) + base_offset
)
self._front_pin_offset = (
Copy link
Contributor

Choose a reason for hiding this comment

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

can we call this _front_calibration_pin_offset and _back_calibration_pin_offset respectively?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if we're only ever going to use one pin to calibrate, should we decide which one and only track that offset? Is the gripper going to be redesigned to only have 1 pin?

Copy link
Member Author

Choose a reason for hiding this comment

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

we should keep these until we bring up the actual calibration process.

Copy link
Member Author

Choose a reason for hiding this comment

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

"""
# TODO: add critical point implementation
return Point(0, 0, 0)
if cp_override == CriticalPoint.GRIPPER_FRONT_CALIBRATION_PIN:
Copy link
Contributor

Choose a reason for hiding this comment

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

If we do decide to just pick one location, can we call this: CriticalPoint.GRIPPER_CALIBRATION?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah

)
self._back_pin_offset = (
Point(*self._config.pin_two_offset_from_base) + base_offset
)
self._calibration_offset = gripper_cal_offset
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to: calibrated_point or something? Makes me think that this is a default configuration rather than a value we got from calibrating the thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not a point though, it's the offset you get from calibration that's added into the rest of the critical point offsets. i'm not sure what else to call it, but maybe comments would help?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm comments are fine for now, I can't think of a better name at the moment other than maybe _mount_to_calibration_pin_offset which is kinda long lol.

if not self._gripper:
return Point(0, 0, 0)
else:
if self._gripper and cp_override != CriticalPoint.MOUNT:
Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed in a DM, but we shouldn't have a Mount critical point for the gripper since the mount w/o a gripper attached cannot move independently of the XY axes and also doesn't have Z movement.

Copy link
Member Author

Choose a reason for hiding this comment

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

sfoster1 added 11 commits July 7, 2022 16:41
For now, add some gripper-specific critical points to the enum that the
gripper handles, and use them to calculate position offsets for motion.
JAW_CENTER is the default, and will be what gets used in most calls when
a gripper is present; the calibration points will be used for calibration.
- It's no longer valid to use the MOUNT cp on a gripper
- There are actual exceptions for using a gripper cp on a pipette and
- vice versa
@sfoster1 sfoster1 force-pushed the RET-1019-gripper-critical-points branch from 8d885d7 to 21b6c37 Compare July 7, 2022 20:59
Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

lgtm

@sfoster1 sfoster1 merged commit ff3dc71 into edge Jul 8, 2022
@sfoster1 sfoster1 deleted the RET-1019-gripper-critical-points branch July 8, 2022 15:12
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