Skip to content

Commit

Permalink
chore(hardware-testing): Mergeback robot testing tags (#13985)
Browse files Browse the repository at this point in the history
* chage the pre__pos and press_pos

* modify Gauge height and Grip height

* add gripper move to

* home gripper after complete the cycles

* format lint

---------

Co-authored-by: Andy-Hu <[email protected]>
Co-authored-by: Andiiiiiiyy <[email protected]>
  • Loading branch information
3 people committed Nov 15, 2023
1 parent 9b1f62a commit 9e05537
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from hardware_testing.opentrons_api.types import Axis, OT3Mount, Point

FAILURE_THRESHOLD_MM = -3
GAUGE_HEIGHT_MM = 40
GRIP_HEIGHT_MM = 30
GAUGE_HEIGHT_MM = 75
GRIP_HEIGHT_MM = 48
TEST_WIDTHS_MM: List[float] = [60, 85.75, 62]
SLOT_WIDTH_GAUGE: List[Optional[int]] = [None, 3, 9]
GRIP_FORCES_NEWTON: List[float] = [10, 15, 20]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ async def _force_gauge(
await api.home([z_ax])
home_pos = await api.gantry_position(mount)
LOG.info(f"Home Position: {home_pos}")
pre_test_pos = home_pos._replace(z=home_pos.z - 110)
pre_test_pos = home_pos._replace(z=home_pos.z - 15)
LOG.info(f"Pre-Test Position: {pre_test_pos}")
press_pos = home_pos._replace(z=pre_test_pos.z - 113)
press_pos = home_pos._replace(z=pre_test_pos.z - 30)
LOG.info(f"Press Position: {press_pos}")

qc_pass = True
Expand Down
82 changes: 82 additions & 0 deletions hardware-testing/hardware_testing/scripts/gripper_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
"""Demo OT3 Gantry Functionality."""
# Author: Carlos Ferandez <[email protected]
import argparse
import asyncio
import time

from hardware_testing.opentrons_api.types import (
OT3Mount,
Axis,
Point,
)
from hardware_testing.opentrons_api.helpers_ot3 import (
build_async_ot3_hardware_api,
)


async def _main() -> None:
hw_api = await build_async_ot3_hardware_api(
is_simulating=args.simulate, use_defaults=True
)
await asyncio.sleep(1)
await hw_api.cache_instruments()
timeout_start = time.time()
timeout = 60 * 60 * 3
count = 0
x_offset = 80
y_offset = 44
try:
await hw_api.home()
await asyncio.sleep(1)
await hw_api.set_lights(rails=True)
home_position = await hw_api.current_position_ot3(mount)
await hw_api.grip(force_newtons=None, stay_engaged=True)
print(f"home: {home_position}")
x_home = home_position[Axis.X] - x_offset
y_home = home_position[Axis.Y] - y_offset
z_home = home_position[Axis.Z_G]
while time.time() < timeout_start + timeout:
# while True:
print(f"time: {time.time()-timeout_start}")
await hw_api.move_to(mount, Point(x_home, y_home, z_home))
await hw_api.move_to(mount, Point(x_home, y_home, z_home - 190))
count += 1
print(f"cycle: {count}")
await hw_api.home()
except KeyboardInterrupt:
await hw_api.disengage_axes([Axis.X, Axis.Y, Axis.G])
finally:
await hw_api.disengage_axes([Axis.X, Axis.Y, Axis.G])
await hw_api.clean_up()


if __name__ == "__main__":
slot_locs = [
"A1",
"A2",
"A3",
"B1",
"B2",
"B3:",
"C1",
"C2",
"C3",
"D1",
"D2",
"D3",
]
parser = argparse.ArgumentParser()
parser.add_argument("--simulate", action="store_true")
parser.add_argument("--trough", action="store_true")
parser.add_argument("--tiprack", action="store_true")
parser.add_argument(
"--mount", type=str, choices=["left", "right", "gripper"], default="gripper"
)
args = parser.parse_args()
if args.mount == "left":
mount = OT3Mount.LEFT
if args.mount == "gripper":
mount = OT3Mount.GRIPPER
else:
mount = OT3Mount.RIGHT
asyncio.run(_main())

0 comments on commit 9e05537

Please sign in to comment.