Skip to content

Commit

Permalink
Fixup: comparison states and safety buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura-Danielle committed Oct 21, 2020
1 parent 5b3499e commit fc44bcb
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions robot-server/robot_server/robot/calibration/check/user_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ def _load_active_tiprack(self) -> labware.Labware:
load onto the deck the default opentrons tip rack labware for this
pipette and return the tip rack labware. If tip_rack_def is supplied,
load specific tip rack from def onto the deck and return the labware.
TODO (lc 10-20-2020) we should load the tipracks from a pipette
offset before trying to load from default.
"""
active_max_vol = self.active_pipette.max_volume
if self._tip_racks:
Expand Down Expand Up @@ -507,26 +510,42 @@ def _get_reference_points_by_state(self):
saved_points.three.final_point

async def register_initial_point(self):
"""
Here we will register the initial and final
points to the current point before jogging
in the instance that a user doesn't jog at
all.
"""
critical_point = self.critical_point_override
current_point = \
await self.get_current_point(critical_point)
buffer = Point(0, 0, 0)
if self.current_state == State.labwareLoaded:
self._reference_points.tip.initial_point = \
current_point + buffer
self._reference_points.tip.final_point = \
current_point + buffer
elif self.current_state == State.inspectingTip:
buffer = MOVE_TO_DECK_SAFETY_BUFFER
self._reference_points.height.initial_point = \
current_point + buffer
self._reference_points.height.final_point = \
current_point + buffer
elif self.current_state == State.comparingHeight:
buffer = MOVE_TO_DECK_SAFETY_BUFFER
self._reference_points.one.initial_point = \
current_point + buffer
self._reference_points.one.final_point = \
current_point + buffer
elif self.current_state == State.comparingPointOne:
self._reference_points.two.initial_point = \
current_point + buffer
self._reference_points.two.final_point = \
current_point + buffer
elif self.current_state == State.comparingPointTwo:
self._reference_points.three.initial_point = \
current_point + buffer
self._reference_points.three.final_point = \
current_point + buffer

async def register_final_point(self):
critical_point = self.critical_point_override
Expand Down Expand Up @@ -575,13 +594,11 @@ async def move_to_tip_rack(self):
handler="move_to_tip_rack",
condition="active tiprack")
if self.current_state == State.labwareLoaded:
MODULE_LOG.debug("homing")
await self.hardware.home()
point = self.active_tiprack.wells()[0].top().point + \
MOVE_TO_TIP_RACK_SAFETY_BUFFER
to_loc = Location(point, None)
await self._move(to_loc)
MODULE_LOG.debug("homing plunger")
await self.hardware.home_plunger(self.mount)
await self._move(Location(self.tip_origin, None))
await self.register_initial_point()
await self.register_final_point()

async def move_to_deck(self):
deck_pt = self._deck.get_slot_center(JOG_TO_DECK_SLOT)
Expand Down

0 comments on commit fc44bcb

Please sign in to comment.