Skip to content

Commit

Permalink
Merge pull request #7 from AD-SDL/doga_dev
Browse files Browse the repository at this point in the history
Pre commit clean ups and adding Height offsets for remove and replace lids
  • Loading branch information
caseystone authored May 7, 2024
2 parents 11d0f6e + 9648112 commit cbf0442
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 188 deletions.
87 changes: 43 additions & 44 deletions src/platecrane_driver/platecrane_driver.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Handle Proper Interfacing with the PlateCrane"""
import json
import re

from pathlib import Path

from serial_port import SerialPort
Expand Down Expand Up @@ -47,14 +46,10 @@ def __init__(self, host_path="/dev/ttyUSB2", baud_rate=9600):
self.platecrane_current_position = None

self.plate_resources = json.load(
open(
Path(__file__).parent / "plate_resources.json"
)
open(Path(__file__).parent / "plate_resources.json")
)
self.stack_resources = json.load(
open(
Path(__file__).parent / "stack_resources.json"
)
open(Path(__file__).parent / "stack_resources.json")
)

self.initialize()
Expand Down Expand Up @@ -716,7 +711,10 @@ def remove_lid(
self.get_new_plate_height(plate_type)

target_offset = (
2 * self.plate_above_height - self.plate_pick_steps_stack + self.lid_height
2 * self.plate_above_height
- self.plate_pick_steps_stack
+ self.lid_height
+ height_offset
) # Finding the correct target hight when only transferring the plate lid
target_loc = self.get_location_joint_values(target)
remove_lid_target = "Temp_Lid_Target_Loc"
Expand Down Expand Up @@ -759,7 +757,10 @@ def replace_lid(
self.get_new_plate_height(plate_type)

target_offset = (
2 * self.plate_above_height - self.plate_pick_steps_stack + self.lid_height
2 * self.plate_above_height
- self.plate_pick_steps_stack
+ self.lid_height
+ height_offset
) # Finding the correct target hight when only transferring the plate lid
source_loc = self.get_location_joint_values(source)
remove_lid_source = "Temp_Lid_Source_loc"
Expand Down Expand Up @@ -971,51 +972,49 @@ def transfer(
sealer = "SealerNest"
# s.move_location("Safe")

# TESTING
# s.pick_stack_plate("Stack1")
# a = s.get_position()
# s.set_location("LidNest3",R=231449,Z=-31500,P=484,Y=-306)

# ----------------------------------------------------------------------------------------------------------------------------------------

# s.pick_stack_plate("Stack1")
# a = s.get_position()
# s.set_location("LidNest3",R=231449,Z=-31500,P=484,Y=-306)

# s.set_location("Hidex.Nest",R=a[0],Z=a[1],P=a[2],Y=a[3])
# s.place_module_plate("Hidex.Nest")
# s.move_single_axis("Z","Hidex.Nest")
# s.transfer("Hidex.Nest","Solo.Position1",source_type="module",target_type="stack",height_offset=800)
# s.transfer("Stack1", "PeelerNest",source_type="stack",target_type="stack")
# s.set_location("Hidex.Nest",R=a[0],Z=a[1],P=a[2],Y=a[3])
# s.place_module_plate("Hidex.Nest")
# s.move_single_axis("Z","Hidex.Nest")
# s.transfer("Hidex.Nest","Solo.Position1",source_type="module",target_type="stack",height_offset=800)
# s.transfer("Stack1", "PeelerNest",source_type="stack",target_type="stack")

# s.place_module_plate()
# s.get_location_list()
# s.place_module_plate()
# s.get_location_list()

# s.move_joints_neutral()
# s.move_single_axis("R", "Safe", delay_time=1)
# s.set_location("Safe",R=195399,Z=0,P=0,Y=0)
# s.set_location("LidNest2",R=131719,Z=-31001,P=-5890,Y=-315)
# s.transfer(source="LidNest1",target="LidNest2",source_type="stack",target_type="stack", plate_type="96_well")
# s.move_joints_neutral()
# s.move_single_axis("R", "Safe", delay_time=1)
# s.set_location("Safe",R=195399,Z=0,P=0,Y=0)
# s.set_location("LidNest2",R=131719,Z=-31001,P=-5890,Y=-315)
# s.transfer(source="LidNest1",target="LidNest2",source_type="stack",target_type="stack", plate_type="96_well")

# s.transfer(source="LidNest2",target="LidNest3",source_type="stack",target_type="stack", plate_type="96_well")
# s.transfer("Stack1","Stack1")
# s.free_joints()
# s.lock_joints()
# s.transfer(source="LidNest2",target="LidNest3",source_type="stack",target_type="stack", plate_type="96_well")
# s.transfer("Stack1","Stack1")
# s.free_joints()
# s.lock_joints()

# s.set_location("LidNest3",R=99817,Z=-31001,P=-5890,Y=-315)
# s.set_location("LidNest3",R=99817,Z=-31001,P=-5890,Y=-315)

# s.get_location_joint_values("HidexNest2")
# s.set_location("HidexNest2", R=210015,Z=-30400,P=490,Y=2323)
# s.get_location_joint_values("HidexNest2")
# s.set_location("HidexNest2", R=210015,Z=-30400,P=490,Y=2323)

# s.transfer(stack5, solo4, source_type = "stack", target_type = "module", plate_type = "96_deep_well")
# s.transfer(solo4, stack5, source_type = "module", target_type = "stack", plate_type = "96_deep_well")
# s.transfer(stack5, solo4, source_type = "stack", target_type = "module", plate_type = "96_deep_well")
# s.transfer(solo4, stack5, source_type = "module", target_type = "stack", plate_type = "96_deep_well")

# s.remove_lid(source = "LidNest1", target="LidNest2", plate_type="96_well")
# s.transfer("Stack4", solo3, source_type = "stack", target_type = "stack", plate_type = "tip_box_lid_off")
# s.remove_lid(source = solo6, target="LidNest3", plate_type="tip_box_lid_on")
# s.replace_lid(source = "LidNest3", target = solo6, plate_type = "tip_box_lid_on")
# s.replace_lid(source = "LidNest2", target = solo4, plate_type = "96_well")
# s.transfer(solo4, stack5, source_type = "module", target_type = "stack", plate_type = "96_well")
# s.transfer(solo6, "Stack2", source_type = "module", target_type = "stack", plate_type = "tip_box_lid_on")
# s.remove_lid(source = "LidNest1", target="LidNest2", plate_type="96_well")
# s.transfer("Stack4", solo3, source_type = "stack", target_type = "stack", plate_type = "tip_box_lid_off")
# s.remove_lid(source = solo6, target="LidNest3", plate_type="tip_box_lid_on")
# s.replace_lid(source = "LidNest3", target = solo6, plate_type = "tip_box_lid_on")
# s.replace_lid(source = "LidNest2", target = solo4, plate_type = "96_well")
# s.transfer(solo4, stack5, source_type = "module", target_type = "stack", plate_type = "96_well")
# s.transfer(solo6, "Stack2", source_type = "module", target_type = "stack", plate_type = "tip_box_lid_on")


# Crash error outputs 21(R axis),14(z axis), 02 Wrong location name. 1400 (Z axis hits the plate), 00 success
# Crash error outputs 21(R axis),14(z axis), 02 Wrong location name. 1400 (Z axis hits the plate), 00 success
# TODO: Need a response handler function. Unkown error messages T1, ATS, TU these are about connection issues (multiple access?)
# TODO: Slow the arm before hitting the plate in pick_stack_plate
# TODO: Create a plate detect function within pick stack plate function
Expand Down
66 changes: 18 additions & 48 deletions src/platecrane_driver/platecrane_locations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NOTE: THIS IS JUST FOR REFERENCE AND IT IS NOT INTEGRATED WITH THE DRIVER
""" THIS IS JUST FOR REFERENCE AND IT IS NOT INTEGRATED WITH THE DRIVER"""

platecrane_locations = {
"Safe": "117902 2349 -5882 0",
Expand All @@ -7,66 +7,36 @@
"TEST1": "-11600 -34445 0 5735",
"TEST2": "100158 -34445 0 -460",
"TEST3": "212416 -34445 0 5735",
"TEST4": " 324175 -34445 0 -460",
"TEST4": "324175 -34445 0 -460",
"PeelerNest": "298872 -30589 -8299 5285",
"TEMP": "166756 -32579 -5882 5460",
"TEMP": "96239 2349 -5866 5462",
"Stack3": "131580 -31925 -5889 5520",
"Stack4": "113890 -31923 -5866 5462",
"Stack5": "96239 -31911 -5866 5462",
"LidNest1": "163105 -31001 -5866 -308",
"LidNest2": "99817 -31001 -5890 -315",
"LidNest2": "131719 -31001 -5890 -315",
"RapidPick.Source": "257776 -31006 -6627 1854",
"RapidPick.Destination": "275183 -30960 -5995 931",
"RapidPick.Destination2": "293181 -30927 -5355 1383",
"Solo.Position2": "-8570 -25921 -9865 1224",
"Solo.Position3": "20085 -26481 -8850 5236",
"Solo.Position2": "-8570 -27000 -9865 1224",
"Solo.Position3": "20085 -27000 -8850 5236",
"Solo.Position6": "48425 -27211 -7818 2793",
"MotorolaScanner.Reader": "224262 -30041 -7281 2793",
"TorreyPinesRIC20.Nest": "-8570 -25921 -9865 1224",
"Solo.Position4": "21612 -27209 -8787 239",
"Hidex.Nest": "210013 -30145 490 2331",
"Hidex.Nest": "209970 -30712 490 2304",
"Liconic.Nest": "79498 -28067 -6710 4099",
"HidexSafe": "209959 -28731 490 -262",
"LidNest1AfterHidex": "163104 -30599 -5866 -308",
"SealerNest": "210256 -1050 491 5730",
"LidNest3": "163106 -31002 -5867 -308",

"Safe": [117902, 2349, -5882, 0],
"Stack1": [166756, -32015, -5882, 5460],
"Stack2": [149127, -31887, -5882, 5460],
"TEST1": -11600, -34445, 0, 5735],
"TEST2": 100158, -34445, 0, -460],
"TEST3": 212416, -34445, 0, 5735],
"TEST4": 324175, -34445, 0, -460],
"PeelerNest": 298872, -30589, -8299, 5285],
"TEMP": 96239, 2349, -5866, 5462],
"Stack3": 131580, -31925, -5889, 5520],
"Stack4": 113890, -31923, -5866, 5462],
"Stack5": 96239, -31911, -5866, 5462],
"LidNest1": 163105, -31001, -5866, -308],
"LidNest2": 131719, -31001, -5890, -315],
"RapidPick.Source": 257776, -31006, -6627, 1854],
"RapidPick.Destination": 275183, -30960, -5995, 931],
"RapidPick.Destination2": 293181, -30927, -5355, 1383],
"Solo.Position2": -8570, -27000, -9865, 1224],
"Solo.Position3": 20085, -27000, -8850, 5236],
"Solo.Position6": 48425, -27211, -7818, 2793],
"MotorolaScanner.Reader", 224262, -30041, -7281, 2793],
"TorreyPinesRIC20.Nest", -8570, -25921, -9865, 1224],
"Solo.Position4", 21612, -27209, -8787, 239],
"Hidex.Nest", 209970, -30712, 490, 2304],
"Liconic.Nest", 79498, -28067, -6710, 4099],
"HidexSafe", 209959, -28731, 490, -262],
"LidNest1AfterHidex", 163104, -30599, -5866, -308],
"SealerNest": 210256, -1050, 491, 5730],
"LidNest3": 99817, -31001, -5890, -315],
"TEMP2": 298872, -30589, -8299, 5285],
"HidexNest2": 210015, -30400, 490, 2323],
"Temp_Lid_Source_Loc": 163106, -31202, -5867, -308],
"Temp_Lid_Target_Loc": [149127, -32487, -5882, 5460],
"stack_source_loc": [96239, -31111, -5866, 5462],
"stack_target_loc":[163106, -26002, -5867, -308],
"source_loc":[21612, -26909, -8787, 239],
"target_loc": [149127, -32187, -5882, 5460],
"Temp_Lid_Source_loc": [99817, -31601, -5890, -315]
}
"LidNest3": "99817 -31001 -5890 -315",
"TEMP2": "298872 -30589 -8299 5285",
"HidexNest2": "210015 -30400 490 2323",
"Temp_Lid_Source_Loc": "163106 -31202 -5867 -308",
"Temp_Lid_Target_Loc": "149127 -32487 -5882 5460",
"stack_source_loc": "96239 -31111 -5866 5462",
"stack_target_loc": "163106 -26002 -5867 -308",
"source_loc": "21612 -26909 -8787 239",
"target_loc": "149127 -32187 -5882 5460",
"Temp_Lid_Source_loc": "99817 -31601 -5890 -315",
}
Loading

0 comments on commit cbf0442

Please sign in to comment.