Exemple #1
0
def test_dispense_move_to(old_aspiration):
    # TODO: same as for aspirate
    robot.reset()
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    p300 = instruments.P300_Single(
                   mount='left',
                   tip_racks=[tip_rack])

    x, y, z = (161.0, 116.7, 0.0)
    plate = containers_load(robot, '96-flat', '1')
    well = plate[0]
    pos = well.from_center(x=0, y=0, z=-1, reference=plate)
    location = (plate, pos)

    robot.poses = p300._move(robot.poses, x=x, y=y, z=z)
    robot.calibrate_container_with_instrument(plate, p300, False)

    p300.pick_up_tip()
    p300.aspirate(100, location)
    p300.dispense(100, location)
    current_pos = pose_tracker.absolute(
        robot.poses,
        p300.instrument_actuator)
    assert (current_pos == (1.5, 0.0, 0.0)).all()

    current_pos = pose_tracker.absolute(robot.poses, p300)
    assert isclose(current_pos, (161,  116.7,   10.5)).all()
Exemple #2
0
def test_aspirate_move_to(old_aspiration):
    # TODO: it seems like this test is checking that the aspirate point is
    # TODO: *fully* at the bottom of the well, which isn't the expected
    # TODO: behavior of aspirate when a location is not specified. This should
    # TODO: be split into two tests--one for this behavior (specifying a place)
    # TODO: and another one for the default
    robot.reset()
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    p300 = instruments.P300_Single(
        mount='left', tip_racks=[tip_rack])
    p300.pick_up_tip()

    x, y, z = (161.0, 116.7, 0.0)
    plate = containers_load(robot, '96-flat', '1')
    well = plate[0]
    pos = well.from_center(x=0, y=0, z=-1, reference=plate)
    location = (plate, pos)

    robot.poses = p300._move(robot.poses, x=x, y=y, z=z)
    robot.calibrate_container_with_instrument(plate, p300, False)

    p300.aspirate(100, location)
    current_pos = pose_tracker.absolute(
        robot.poses,
        p300.instrument_actuator)

    assert (current_pos == (6.889964, 0.0, 0.0)).all()

    current_pos = pose_tracker.absolute(robot.poses, p300)
    assert isclose(current_pos, (161,  116.7,   10.5)).all()
Exemple #3
0
def test_pos_tracker_persistance(virtual_smoothie_env):
    robot.reset()
    p300 = instruments.P300_Single(mount='left')
    plate = containers_load(robot, 'trough-12row', '5')
    assert robot.max_placeable_height_on_deck(plate) == 40.0

    robot.poses = p300._move(robot.poses, x=10, y=10, z=10)
    robot.calibrate_container_with_instrument(plate, p300, save=False)

    assert robot.max_placeable_height_on_deck(plate) == 10.0
Exemple #4
0
def test_create_arc(virtual_smoothie_env):
    from opentrons.legacy_api.robot.robot import (TIP_CLEARANCE_DECK,
                                                  TIP_CLEARANCE_LABWARE)
    robot.reset()

    p300 = instruments.P300_Single(mount='left')
    plate = containers_load(robot, '96-flat', '1')
    plate2 = containers_load(robot, '96-flat', '2')

    new_labware_height = 10
    robot.poses = p300._move(robot.poses, x=10, y=10, z=new_labware_height)
    robot.calibrate_container_with_instrument(plate, p300, save=False)

    trash_height = robot.max_placeable_height_on_deck(robot.fixed_trash)
    assert robot.max_deck_height() == trash_height

    res = robot._create_arc(p300, (0, 0, 0), plate[0])
    arc_top = robot.max_deck_height() + TIP_CLEARANCE_DECK
    expected = [
        {'z': arc_top},
        {'x': 0, 'y': 0},
        {'z': 0}
    ]
    assert res == expected

    res = robot._create_arc(p300, (0, 0, 0), plate[1])
    arc_top = robot.max_placeable_height_on_deck(plate) + TIP_CLEARANCE_LABWARE
    expected = [
        {'z': arc_top},
        {'x': 0, 'y': 0},
        {'z': 0}
    ]
    assert res == expected

    new_labware_height = 200
    robot.poses = p300._move(robot.poses, x=10, y=10, z=new_labware_height)
    robot.calibrate_container_with_instrument(plate2, p300, save=False)

    assert robot.max_deck_height() == new_labware_height

    res = robot._create_arc(p300, (0, 0, 0), plate2[0])
    arc_top = p300._max_deck_height()
    expected = [
        {'z': arc_top},
        {'x': 0, 'y': 0},
        {'z': 0}
    ]
    assert res == expected
Exemple #5
0
def test_calibrate_labware(virtual_smoothie_env, monkeypatch):
    import tempfile
    temp = tempfile.mkdtemp()
    monkeypatch.setenv('USER_DEFN_ROOT', temp)
    robot.reset()

    plate = labware.load('96-flat', '1')
    pip = instruments.P300_Single(mount='right')

    old_x, old_y, old_z = pose_tracker.absolute(robot.poses, plate[0])

    pip.move_to(plate[0])
    robot.poses = pip._jog(robot.poses, 'x', 1)
    robot.poses = pip._jog(robot.poses, 'y', 2)
    robot.poses = pip._jog(robot.poses, 'z', -3)
    robot.calibrate_container_with_instrument(plate, pip, save=False)
    new_pose = pose_tracker.absolute(robot.poses, plate[0])

    assert isclose(new_pose, (old_x + 1, old_y + 2, old_z - 3)).all()
Exemple #6
0
def test_calibrate_labware_new(
        virtual_smoothie_env, split_labware_def):
    robot.reset()

    plate = labware.load('96-flat', '5')
    pip = instruments.P300_Single(mount='right')

    old_x, old_y, old_z = pose_tracker.absolute(robot.poses, plate[0])

    pip.move_to(plate[0])
    robot.poses = pip._jog(robot.poses, 'x', 1)
    robot.poses = pip._jog(robot.poses, 'y', 2)
    robot.poses = pip._jog(robot.poses, 'z', -3)
    robot.calibrate_container_with_instrument(plate, pip, save=True)
    new_pose = pose_tracker.absolute(robot.poses, plate[0])

    assert isclose(new_pose, (old_x + 1, old_y + 2, old_z - 3)).all()

    # Ensure that slot offset is removed and new offset file is picked up
    plate2 = labware.load('96-flat', '1')
    new_pose2 = pose_tracker.absolute(robot.poses, plate2[0])
    assert isclose(new_pose2, (15.34, 76.24, 7.5)).all()