def add_container_to_pose_tracker(self, location, container: Container): """ Add container and child wells to pose tracker. Sets container.parent (slot) as pose tracker parent """ self.poses = pose_tracker.add( self.poses, container, container.parent, pose_tracker.Point(*container._coordinates)) for well in container: center_x, center_y, center_z = well.top()[1] offset_x, offset_y, offset_z = well._coordinates center_z = 0 self.poses = pose_tracker.add( self.poses, well, container, pose_tracker.Point( center_x + offset_x, center_y + offset_y, center_z + offset_z ) )
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')
def update_config(self, **kwargs): """ Replace configuration values. kwargs should contain configuration keys. For instance: `robot.update_config(name='Grace Hopper')` will update the `name` key of the configuration. """ # Deck CLI tool needs to update the pose_tracker in real time to # successfully save tip probe center. Here, update the position # with freshly determined deck transform. if 'gantry_calibration' in kwargs: self.poses = pose_tracker.update(self.poses, self._gantry_cal_id, point=pose_tracker.Point(0, 0, 0), transform=array( kwargs['gantry_calibration'])) self.config = self.config._replace(**kwargs)
def _calibrate_container_with_delta(pose_tree, container, delta_x, delta_y, delta_z, save, new_container_name=None): delta = pose_tracker.Point(delta_x, delta_y, delta_z) # Note: pose tree is updated here, in order to update in-memory state. # Separately from that, on-disk state is updated. This is a point of # possible dis-unity. Would probably work better to un-load the labware # after calibration, and then reload it (would have to figure out where # in the call-stack this could be done without raising exceptions due # to trying to access old references). # Have to update all of the things in the pose tree that have the same # load name, otherwise you end up getting the calibration values # added together in the on-disk representation target_name = container.get_name() matching_entries = [ x for x in list(pose_tree.keys()) if type(x) == Container and x.get_name() == target_name ] for entry in matching_entries: old_coordinates = pose_tracker.change_base(pose_tree, src=entry, dst=entry.parent) new_coordinates = old_coordinates + delta pose_tree = pose_tracker.update(pose_tree, entry, new_coordinates) entry._coordinates = entry._coordinates + delta if save and container.properties.get('labware_hash'): save_new_offsets(container.properties['labware_hash'], delta, container.properties['definition']) elif save and new_container_name: database.save_new_container(container, new_container_name) elif save: database.overwrite_container(container) return pose_tree
def _calibrate_container_with_delta(pose_tree, container, delta_x, delta_y, delta_z, save, new_container_name=None): delta = pose_tracker.Point(delta_x, delta_y, delta_z) new_coordinates = pose_tracker.change_base( pose_tree, src=container, dst=container.parent) + delta pose_tree = pose_tracker.update(pose_tree, container, new_coordinates) container._coordinates = container._coordinates + delta if save and container.properties.get('labware_hash'): save_new_offsets(container.properties['labware_hash'], delta) elif save and new_container_name: database.save_new_container(container, new_container_name) elif save: database.overwrite_container(container) return pose_tree