From 308c63758b67d5d4d40ded9fcbd3c202bd9a5473 Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Mon, 18 Dec 2023 15:22:51 -0500 Subject: [PATCH] Let's support z-coordinates in offsets. --- .../commands/move_to_addressable_area.py | 2 +- api/src/opentrons/protocol_engine/state/motion.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/api/src/opentrons/protocol_engine/commands/move_to_addressable_area.py b/api/src/opentrons/protocol_engine/commands/move_to_addressable_area.py index d024076e717..7dfc0b53895 100644 --- a/api/src/opentrons/protocol_engine/commands/move_to_addressable_area.py +++ b/api/src/opentrons/protocol_engine/commands/move_to_addressable_area.py @@ -59,7 +59,7 @@ class MoveToAddressableAreaParams(PipetteIdMixin, MovementMixin): description=( "If `true`, the pipette will retract to its highest possible height" " and stay there instead of descending to the destination." - " `minimumZHeight` and the z-coordinate of `offset` will be ignored." + " `minimumZHeight` will be ignored." ), ) diff --git a/api/src/opentrons/protocol_engine/state/motion.py b/api/src/opentrons/protocol_engine/state/motion.py index 4dd91395a6d..bb22778364a 100644 --- a/api/src/opentrons/protocol_engine/state/motion.py +++ b/api/src/opentrons/protocol_engine/state/motion.py @@ -163,15 +163,19 @@ def get_movement_waypoints_to_addressable_area( addressable_area_name ) ) - destination = base_destination + Point(x=offset.x, y=offset.y, z=offset.z) if stay_at_max_travel_z: - destination = Point( - destination.x, - destination.y, + base_destination_at_max_z = Point( + base_destination.x, + base_destination.y, # FIX BEFORE MERGE: Explain this hack. # Possibly related: https://github.com/Opentrons/opentrons/pull/6882#discussion_r514248062 max_travel_z - _STAY_AT_MAX_TRAVEL_Z_MARGIN, ) + destination = base_destination_at_max_z + Point( + offset.x, offset.y, offset.z + ) + else: + destination = base_destination + Point(offset.x, offset.y, offset.z) # TODO(jbl 11-28-2023) This may need to change for partial tip configurations on a 96 destination_cp = CriticalPoint.XY_CENTER