-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(api): add extension mount and axes to top level types #12671
feat(api): add extension mount and axes to top level types #12671
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple hardware-specific changes I'd like to see unfortunately
if axes: | ||
assert all( | ||
axis in Axis.ot2_axes() for axis in axes | ||
), "Received a non-OT2 axis for homing." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is correct modulo using a more specific exception than AssertionError
- I think we want like a NotSupportedByHardware
error
@@ -138,7 +138,7 @@ def _sanitize_attached_instrument( | |||
|
|||
self._attached_instruments = { | |||
m: _sanitize_attached_instrument(attached_instruments.get(m)) | |||
for m in types.Mount | |||
for m in types.Mount # Check if addition of extension Mount creates issues for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like we should just use ot2_mounts
here?
X = 0 # Gantry X | ||
Y = 1 # Gantry Y | ||
Z = 2 # left pipette mount Z | ||
A = 3 # right pipette mount Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to change the ot3 stuff to use Z
/A
/B
/C
. I think we should handle Z_L
, Z_R
, P_L
, P_R
. I think this can be handled in one of two ways:
- Just add them. Add per-machine iterators
ot2_axes
andflex_axes
like we have for the mounts. It's non-unique now, that's fine. - Make it two types again but now they're top-level and have some sort of equivalence relationship
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, not sure which change you are talking about here. There are still two different axis types- Axis
and OT3Axis
, and OT3Axis uses Z_L, Z_R, etc
. Here I've only added comments and Gripper Z & Jaw to the existing Axis
type.
Codecov Report
@@ Coverage Diff @@
## edge #12671 +/- ##
==========================================
+ Coverage 73.35% 73.42% +0.06%
==========================================
Files 2261 2267 +6
Lines 61480 62313 +833
Branches 6782 6666 -116
==========================================
+ Hits 45098 45751 +653
- Misses 14763 14951 +188
+ Partials 1619 1611 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, looks good to me based on a convo - let's merge Axis and OT3Axis in a followup!
Closes RLAB-219 & RLAB-231
Overview
Inside
opentrons.types
,Mount
,MountType
Axis
.Test Plan
moveToMaintenancePosition
with gripper mount, moves the gantry to the given x, y location, ignoring the z offset. (this will potentially fail until point2 in review requests is addressed).Changelog
The only user-facing changes are:
EXTENSION
type to Mount and MountTypeZ_G
andG
axes toAxis
typeprotocol_context.load_instruments
now raises error whenMount.EXTENSION
is used formount
arg.Client-facing change for HTTP layer is:
extension_z
andextension_jaw
for axis inhome
commandNon-user/client facing changes mostly fall under these categories:
Mount
andAxis
to include extension mount and axesMount
type, restrict the iteration to OT2 mount types when using OT2, or restrict the iteration to pipette mounts only when the code is relevant to pipette mounts only.Review requests
home
command. This simple requirement trickled down into needing to update the top levelAxis
type, which required updating theMount
&MountType
types for keeping their inter-dependency valid. Do you think the chain of changes is justified and in the end is a change we want to make- i.e., we wanttypes.Axis
to reflect all the axes available- or would it be instead better to not have to update the top level types and keep the change restricted to just protocol engine? (basically by updating onlyengine.types.MotorAxis
and handling homing the gripper axes with a special call to ot3api.home with axes specified inOT3Axis
type)moveToMaintenancePosition
to move the gripper mount to maintenance position during attach/detach. But this cannot be fully supported without a change in hardware controller since there is no 'gripper mount' available to move when there is no gripper attached. So in essence we want to just move the gantry to a specified x, y location in order to perform gripper attachment. So one can argue that we don't necessarily need the extension mount type specified in order to do such a move.ot3api.move_to
to move the hardware mounting plate of gripper mount to a specific (x, y) location when executingmove_to(mount=OT3Mount.GRIPPER, abs_position=..)
without a gripper attached. Which way sounds better? If it's a significant change then I'll address it in a follow-up PR.Risk assessment
Medium-High: