-
Notifications
You must be signed in to change notification settings - Fork 178
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(engine): move pipettes away if blocking heater-shaker open latch or start shake #11248
Changes from 6 commits
1b2090a
cc958eb
cf70127
3aca3d5
d38a232
4aae7a4
af17588
b4203a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,13 @@ | |
|
||
from pydantic import BaseModel, Field | ||
|
||
from opentrons.protocol_engine.types import MotorAxis | ||
|
||
from ..command import AbstractCommandImpl, BaseCommand, BaseCommandCreate | ||
|
||
if TYPE_CHECKING: | ||
from opentrons.protocol_engine.state import StateView | ||
from opentrons.protocol_engine.execution import EquipmentHandler | ||
from opentrons.protocol_engine.execution import EquipmentHandler, MovementHandler | ||
|
||
OpenLabwareLatchCommandType = Literal["heaterShaker/openLabwareLatch"] | ||
|
||
|
@@ -33,10 +35,12 @@ def __init__( | |
self, | ||
state_view: StateView, | ||
equipment: EquipmentHandler, | ||
movement: MovementHandler, | ||
**unused_dependencies: object, | ||
) -> None: | ||
self._state_view = state_view | ||
self._equipment = equipment | ||
self._movement = movement | ||
|
||
async def execute(self, params: OpenLabwareLatchParams) -> OpenLabwareLatchResult: | ||
"""Open a Heater-Shaker's labware latch.""" | ||
|
@@ -47,6 +51,17 @@ async def execute(self, params: OpenLabwareLatchParams) -> OpenLabwareLatchResul | |
|
||
hs_module_substate.raise_if_shaking() | ||
|
||
# Check if pipette would block opening latch if east, west, or on top of module | ||
if self._state_view.motion.check_pipette_blocking_hs_latch( | ||
hs_module_substate.module_id | ||
): | ||
await self._movement.home( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the discussion w/ the group on Tuesday I think we to move towards using pipette retraction instead of homing both here and before thermocycler lid movements. So I'd leave a TODO here to switch to using pipette retraction. |
||
[ | ||
MotorAxis.RIGHT_Z, | ||
MotorAxis.LEFT_Z, | ||
] | ||
) | ||
|
||
# Allow propagation of ModuleNotAttachedError. | ||
hs_hardware_module = self._equipment.get_module_hardware_api( | ||
hs_module_substate.module_id | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,11 +5,13 @@ | |||||
|
||||||
from pydantic import BaseModel, Field | ||||||
|
||||||
from opentrons.protocol_engine.types import MotorAxis | ||||||
|
||||||
from ..command import AbstractCommandImpl, BaseCommand, BaseCommandCreate | ||||||
|
||||||
if TYPE_CHECKING: | ||||||
from opentrons.protocol_engine.state import StateView | ||||||
from opentrons.protocol_engine.execution import EquipmentHandler | ||||||
from opentrons.protocol_engine.execution import EquipmentHandler, MovementHandler | ||||||
|
||||||
SetAndWaitForShakeSpeedCommandType = Literal["heaterShaker/setAndWaitForShakeSpeed"] | ||||||
|
||||||
|
@@ -36,10 +38,12 @@ def __init__( | |||||
self, | ||||||
state_view: StateView, | ||||||
equipment: EquipmentHandler, | ||||||
movement: MovementHandler, | ||||||
**unused_dependencies: object, | ||||||
) -> None: | ||||||
self._state_view = state_view | ||||||
self._equipment = equipment | ||||||
self._movement = movement | ||||||
|
||||||
async def execute( | ||||||
self, | ||||||
|
@@ -56,6 +60,17 @@ async def execute( | |||||
# Verify speed from hs module view | ||||||
validated_speed = hs_module_substate.validate_target_speed(params.rpm) | ||||||
|
||||||
# Check if pipette would block opening latch if adjacent or on top of module | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if self._state_view.motion.check_pipette_blocking_hs_shaker( | ||||||
hs_module_substate.module_id | ||||||
): | ||||||
await self._movement.home( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same TODO comment as above. |
||||||
[ | ||||||
MotorAxis.RIGHT_Z, | ||||||
MotorAxis.LEFT_Z, | ||||||
] | ||||||
) | ||||||
|
||||||
# Allow propagation of ModuleNotAttachedError. | ||||||
hs_hardware_module = self._equipment.get_module_hardware_api( | ||||||
hs_module_substate.module_id | ||||||
|
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.
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 would specify the east/west location details in the docstring for
check_pipette_blocking_hs_latch
. Just a soft preference.