Exemplo n.º 1
0
    def __init__(self,
                 hardware: ThreadManager):
        self._hardware = hardware
        self._hw_pipette, self._mount = self._select_target_pipette()

        deck_load_name = SHORT_TRASH_DECK if ff.short_fixed_trash() \
            else STANDARD_DECK
        self._deck = deck.Deck(load_name=deck_load_name)
        self._tip_rack = self._get_tip_rack_lw()
        self._deck[TIP_RACK_SLOT] = self._tip_rack

        self._current_state = State.sessionStarted
        self._state_machine = DeckCalibrationStateMachine()

        self._tip_origin_pt: Optional[Point] = None
        self._z_height_reference: Optional[float] = None
        self._expected_points = self._build_expected_points_dict()
        self._saved_points: SavedPoints = {}

        self._command_map: COMMAND_MAP = {
            CalibrationCommand.load_labware: self.load_labware,
            CalibrationCommand.jog: self.jog,
            CalibrationCommand.pick_up_tip: self.pick_up_tip,
            CalibrationCommand.invalidate_tip: self.invalidate_tip,
            CalibrationCommand.save_offset: self.save_offset,
            CalibrationCommand.move_to_tip_rack: self.move_to_tip_rack,
            CalibrationCommand.move_to_deck: self.move_to_deck,
            CalibrationCommand.move_to_point_one: self.move_to_point_one,
            DeckCalibrationCommand.move_to_point_two: self.move_to_point_two,
            DeckCalibrationCommand.move_to_point_three: self.move_to_point_three,  # noqa: E501
            CalibrationCommand.exit: self.exit_session,
        }
Exemplo n.º 2
0
    def __init__(self,
                 hardware: ThreadManager,
                 mount: Mount,
                 has_calibration_block: bool,
                 tip_rack: 'LabwareDefinition'):
        self._tip_rack_definition = tip_rack
        self._hardware = hardware
        self._mount = mount
        self._has_calibration_block = has_calibration_block
        self._hw_pipette = self._hardware._attached_instruments[mount]
        if not self._hw_pipette:
            raise ErrorExc(Error.NO_PIPETTE, mount)
        self._tip_origin_pt: Optional[Point] = None
        self._nozzle_height_at_reference: Optional[float] = None

        deck_load_name = SHORT_TRASH_DECK if ff.short_fixed_trash() \
            else STANDARD_DECK
        self._deck = geometry.Deck(load_name=deck_load_name)
        self._initialize_deck()

        self._current_state = State.sessionStarted
        self._state_machine = TipCalibrationStateMachine()

        self._command_map: COMMAND_MAP = {
            CalibrationCommand.load_labware: self.load_labware,
            CalibrationCommand.jog: self.jog,
            CalibrationCommand.pick_up_tip: self.pick_up_tip,
            CalibrationCommand.invalidate_tip: self.invalidate_tip,
            CalibrationCommand.save_offset: self.save_offset,
            TipLengthCalibrationCommand.move_to_reference_point: self.move_to_reference_point,  # noqa: E501
            TipLengthCalibrationCommand.move_to_tip_rack: self.move_to_tip_rack,  # noqa: E501
            CalibrationCommand.exit: self.exit_session,
        }
Exemplo n.º 3
0
    def __init__(self, hardware: ThreadManager, mount: Mount = Mount.RIGHT):
        self._hardware = hardware
        self._mount = mount
        self._hw_pipette = self._hardware._attached_instruments[mount]
        if not self._hw_pipette:
            raise RobotServerError(
                definition=CalibrationError.NO_PIPETTE_ON_MOUNT, mount=mount)

        deck_load_name = SHORT_TRASH_DECK if ff.short_fixed_trash() \
            else STANDARD_DECK
        self._deck = deck.Deck(load_name=deck_load_name)
        self._tip_rack = self._get_tip_rack_lw()
        self._deck[TIP_RACK_SLOT] = self._tip_rack

        self._current_state = State.sessionStarted
        self._state_machine = PipetteOffsetCalibrationStateMachine()

        point_one_pos = \
            self._deck.get_calibration_position(POINT_ONE_ID).position
        self._cal_ref_point = Point(*point_one_pos)

        self._tip_origin_pt: Optional[Point] = None

        self._command_map: COMMAND_MAP = {
            CalibrationCommand.load_labware: self.load_labware,
            CalibrationCommand.jog: self.jog,
            CalibrationCommand.pick_up_tip: self.pick_up_tip,
            CalibrationCommand.invalidate_tip: self.invalidate_tip,
            CalibrationCommand.save_offset: self.save_offset,
            CalibrationCommand.move_to_tip_rack: self.move_to_tip_rack,
            CalibrationCommand.move_to_deck: self.move_to_deck,
            CalibrationCommand.move_to_point_one: self.move_to_point_one,
            CalibrationCommand.exit: self.exit_session,
        }
Exemplo n.º 4
0
    def setup_deck(self):
        self.add_slots_to_deck()

        # Setup Deck as root object for pose tracker
        self.poses = pose_tracker.add(
            self.poses,
            self._deck
        )

        for slot in self._deck:
            self.poses = pose_tracker.add(
                self.poses,
                slot,
                self._deck,
                pose_tracker.Point(*slot._coordinates)
            )

        # @TODO (Laura & Andy) Slot and type of trash
        # needs to be pulled from config file
        if fflags.short_fixed_trash():
            self._fixed_trash = self.add_container(
                'opentrons_1_trash_850ml_fixed', '12')
        else:
            self._fixed_trash = self.add_container(
                'opentrons_1_trash_1100ml_fixed', '12')
Exemplo n.º 5
0
    def __init__(self,
                 hardware: ThreadManager,
                 lights_on_before: bool = False):
        self._hardware = hardware
        self._lights_on_before = lights_on_before

        deck_load_name = SHORT_TRASH_DECK if ff.short_fixed_trash() \
            else STANDARD_DECK
        self._deck = geometry.Deck(load_name=deck_load_name)
        self._pip_info_by_mount = self._get_pip_info_by_mount(
            hardware.get_attached_instruments())
        self._labware_info = self._determine_required_labware()
        self._moves = self._build_deck_moves()
Exemplo n.º 6
0
 def __init__(self, hardware: ThreadManager):
     self._hardware = hardware
     self._deck = geometry.Deck()
     self._pip_info_by_mount = self._get_pip_info_by_mount(
             hardware.get_attached_instruments())
     if ff.short_fixed_trash():
         trash_lw = labware.load(
             'opentrons_1_trash_850ml_fixed',
             self._deck.position_for('12'))
     else:
         trash_lw = labware.load(
             'opentrons_1_trash_1100ml_fixed',
             self._deck.position_for('12'))
     self._deck['12'] = trash_lw
     self._trash_lw = trash_lw
     self._labware_info = self._determine_required_labware()
     self._moves = self._build_deck_moves()
Exemplo n.º 7
0
def _default_probe_dimensions():
    if fflags.short_fixed_trash():
        probe_height = 55.0
    else:
        probe_height = DEFAULT_PROBE_HEIGHT
    return [35.0, 40.0, probe_height + 5.0]
Exemplo n.º 8
0
def _default_probe_center():
    if fflags.short_fixed_trash():
        probe_height = 55.0
    else:
        probe_height = DEFAULT_PROBE_HEIGHT
    return [293.03, 301.27, probe_height]
Exemplo n.º 9
0
    def __init__(self,
                 loop: asyncio.AbstractEventLoop = None,
                 hardware: HardwareToManage = None,
                 broker=None,
                 bundled_labware: Dict[str, LabwareDefinition] = None,
                 bundled_data: Dict[str, bytes] = None,
                 extra_labware: Dict[str, LabwareDefinition] = None,
                 api_version: APIVersion = None,
                 ) -> None:
        """ Build a :py:class:`.ProtocolContext`.

        :param loop: An event loop to use. If not specified, this ctor will
                     (eventually) call :py:meth:`asyncio.get_event_loop`.
        :param hardware: An optional hardware controller to link to. If not
                         specified, a new simulator will be created.
        :param broker: An optional command broker to link to. If not
                      specified, a dummy one is used.
        :param bundled_labware: A dict mapping labware URIs to definitions.
                                This is used when executing bundled protocols,
                                and if specified will be the only allowed
                                source for labware definitions, excluding the
                                built in definitions and anything in
                                ``extra_labware``.
        :param bundled_data: A dict mapping filenames to the contents of data
                             files. Can be used by the protocol, since it is
                             exposed as
                             :py:attr:`.ProtocolContext.bundled_data`
        :param extra_labware: A dict mapping labware URIs to definitions. These
                              URIs are searched during :py:meth:`.load_labware`
                              in addition to the system definitions (if
                              ``bundled_labware`` was not specified). Used to
                              provide custom labware definitions.
        :param api_version: The API version to use. If this is ``None``, uses
                            the max supported version.
        """
        super().__init__(broker)

        self._api_version = api_version or MAX_SUPPORTED_VERSION
        if self._api_version > MAX_SUPPORTED_VERSION:
            raise RuntimeError(
                f'API version {self._api_version} is not supported by this '
                f'robot software. Please either reduce your requested API '
                f'version or update your robot.')
        self._loop = loop or asyncio.get_event_loop()
        self._deck_layout = geometry.Deck()
        self._instruments: Dict[types.Mount, Optional[InstrumentContext]]\
            = {mount: None for mount in types.Mount}
        self._modules: Set[ModuleContext] = set()
        self._last_moved_instrument: Optional[types.Mount] = None
        self._location_cache: Optional[types.Location] = None

        self._hw_manager = HardwareManager(hardware)
        self._log = MODULE_LOG.getChild(self.__class__.__name__)
        self._commands: List[str] = []
        self._unsubscribe_commands = None
        self.clear_commands()

        self._bundled_labware = bundled_labware
        self._extra_labware = extra_labware or {}

        self._bundled_data: Dict[str, bytes] = bundled_data or {}
        self._default_max_speeds = AxisMaxSpeeds()
        if fflags.short_fixed_trash():
            trash_name = 'opentrons_1_trash_850ml_fixed'
        else:
            trash_name = 'opentrons_1_trash_1100ml_fixed'
        if self._deck_layout['12']:
            del self._deck_layout['12']
        self.load_labware(trash_name, '12')