Skip to content

Commit

Permalink
address remainder comments, fixed pipette extents bounding along x-axis
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Jan 8, 2024
1 parent 6bff4d7 commit ced6577
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
31 changes: 16 additions & 15 deletions api/src/opentrons/protocol_api/core/engine/deck_conflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ def __init__(self, message: str) -> None:

# TODO (spp, 2023-12-06): move this to a location like motion planning where we can
# derive these values from geometry definitions
# Also, verify y-axis extents values for the nozzle columns.
# Bounding box measurements
A12_column_front_left_bound = Point(x=-1.8, y=2)
A12_column_back_right_bound = Point(x=592, y=506.2)

A1_column_front_left_bound = Point(x=-100.8, y=2)
A1_column_back_right_bound = Point(x=493, y=506.2)
A12_column_front_left_bound = Point(x=-11.03, y=2)
A12_column_back_right_bound = Point(x=526.77, y=506.2)

_NOZZLE_PITCH = 9
A1_column_front_left_bound = Point(x=A12_column_front_left_bound.x - _NOZZLE_PITCH * 11, y=2)
A1_column_back_right_bound = Point(x=A12_column_back_right_bound.x - _NOZZLE_PITCH * 11, y=506.2)

# Arbitrary safety margin in z-direction
Z_SAFETY_MARGIN = 10
Expand Down Expand Up @@ -255,7 +256,7 @@ def _check_deck_conflict_for_96_channel(
engine_state.pipettes.get_nozzle_layout_type(pipette_id)
== NozzleConfigurationType.COLUMN
):
# Checking deck conflicts only for 12th column config
# Checking deck conflicts only for column config
return

if isinstance(well_location, DropTipWellLocation):
Expand Down Expand Up @@ -330,7 +331,7 @@ def _check_deck_conflict_for_8_channel(
engine_state.pipettes.get_nozzle_layout_type(pipette_id)
== NozzleConfigurationType.SINGLE
):
# Checking deck conflicts only for H1 single tip config
# Checking deck conflicts only for single tip config
return

if isinstance(well_location, DropTipWellLocation):
Expand Down Expand Up @@ -408,20 +409,20 @@ def _is_within_pipette_extents(
if primary_nozzle == "A12":
return (
A12_column_front_left_bound.x
< location.x
< A12_column_back_right_bound.x
<= location.x
<= A12_column_back_right_bound.x
and A12_column_front_left_bound.y
< location.y
< A12_column_back_right_bound.y
<= location.y
<= A12_column_back_right_bound.y
)
elif primary_nozzle == "A1":
return (
A1_column_front_left_bound.x
< location.x
< A1_column_back_right_bound.x
<= location.x
<= A1_column_back_right_bound.x
and A1_column_front_left_bound.y
< location.y
< A1_column_back_right_bound.y
<= location.y
<= A1_column_back_right_bound.y
)
# TODO (spp, 2023-11-07): check for 8-channel nozzle A1 & H1 extents on Flex & OT2
return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def get_expected_mapping_result() -> wrapped_deck_conflict.DeckItem:
),
# Out-of-bounds error
(
Point(x=-10, y=100, z=60),
Point(x=-12, y=100, z=60),
pytest.raises(
deck_conflict.PartialTipMovementNotAllowedError,
match="outside of robot bounds",
Expand Down

0 comments on commit ced6577

Please sign in to comment.