Skip to content

Commit

Permalink
remove z safety margin
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Mar 8, 2024
1 parent be34672 commit 5bee5d3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
5 changes: 1 addition & 4 deletions api/src/opentrons/protocol_api/core/engine/deck_conflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ def __init__(self, message: str) -> None:
x=A12_column_back_right_bound.x - _NOZZLE_PITCH * 11, y=506.2
)

# Arbitrary safety margin in z-direction
Z_SAFETY_MARGIN = 10

_FLEX_TC_LID_BACK_LEFT_PT = Point(
x=FLEX_TC_LID_COLLISION_ZONE["back_left"]["x"],
y=FLEX_TC_LID_COLLISION_ZONE["back_left"]["y"],
Expand Down Expand Up @@ -333,7 +330,7 @@ def _slot_has_potential_colliding_object(
slot_highest_z = engine_state.geometry.get_highest_z_in_slot(
StagingSlotLocation(slotName=surrounding_slot)
)
return slot_highest_z + Z_SAFETY_MARGIN > pipette_bounds[0].z
return slot_highest_z >= pipette_bounds[0].z
return False


Expand Down
2 changes: 2 additions & 0 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ def home_plunger(self) -> InstrumentContext:
self._core.home_plunger()
return self

# TODO (spp, 2024-03-08): verify if ok to & change source & dest types to AdvancedLiquidHandling
@publisher.publish(command=cmds.distribute)
@requires_version(2, 0)
def distribute(
Expand Down Expand Up @@ -1142,6 +1143,7 @@ def distribute(

return self.transfer(volume, source, dest, **kwargs)

# TODO (spp, 2024-03-08): verify if ok to & change source & dest types to AdvancedLiquidHandling
@publisher.publish(command=cmds.consolidate)
@requires_version(2, 0)
def consolidate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,36 @@ def test_deck_conflicts_for_96_ch_a12_column_configuration() -> None:
instrument.dispense(50, accessible_plate.wells_by_name()["A1"])


@pytest.mark.ot3_only
def test_close_shave_deck_conflicts_for_96_ch_a12_column_configuration() -> None:
"""Shouldn't raise errors for "almost collision"s."""
protocol_context = simulate.get_protocol_api(version="2.16", robot_type="Flex")
res12 = protocol_context.load_labware("nest_12_reservoir_15ml", "C3")

# Mag block and tiprack adapter are very close to the destination reservoir labware
protocol_context.load_module("magneticBlockV1", "D2")
protocol_context.load_labware(
"opentrons_flex_96_tiprack_200ul",
"B3",
adapter="opentrons_flex_96_tiprack_adapter",
)
tiprack_8 = protocol_context.load_labware("opentrons_flex_96_tiprack_200ul", "B2")
hs = protocol_context.load_module("heaterShakerModuleV1", "D1")
hs_adapter = hs.load_adapter("opentrons_96_deep_well_adapter")
deepwell = hs_adapter.load_labware("nest_96_wellplate_2ml_deep")
protocol_context.load_trash_bin("A3")
p1000_96 = protocol_context.load_instrument("flex_96channel_1000")
p1000_96.configure_nozzle_layout(style=COLUMN, start="A12", tip_racks=[tiprack_8])

hs.close_labware_latch() # type: ignore[union-attr]
p1000_96.distribute(
15,
res12.wells()[0],
deepwell.rows()[0],
disposal_vol=0,
)


@pytest.mark.ot3_only
def test_deck_conflicts_for_96_ch_a1_column_configuration() -> None:
"""It should raise errors for expected deck conflicts."""
Expand Down

0 comments on commit 5bee5d3

Please sign in to comment.