Skip to content

Commit

Permalink
iswap negative direction (#345)
Browse files Browse the repository at this point in the history
Co-authored-by: Rick Wierenga <[email protected]>
  • Loading branch information
ben-ray and rickwierenga authored Jan 2, 2025
1 parent 5619a08 commit b4ff02c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
39 changes: 21 additions & 18 deletions pylabrobot/liquid_handling/backends/hamilton/STAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -2778,13 +2778,13 @@ async def pick_up_resource(
hotel_open_gripper_position = pickup.resource.get_absolute_size_y() + 5

await self.unsafe.get_from_hotel(
hotel_center_x_coord=round(x * 10),
hotel_center_y_coord=round(y * 10),
hotel_center_x_coord=round(abs(x) * 10),
hotel_center_y_coord=round(abs(y) * 10),
# hotel_center_z_coord=int((z * 10)+0.5), # use sensible rounding (.5 goes up)
hotel_center_z_coord=round(z * 10),
hotel_center_x_direction=0,
hotel_center_y_direction=0,
hotel_center_z_direction=0,
hotel_center_z_coord=round(abs(z) * 10),
hotel_center_x_direction=0 if x >= 0 else 1,
hotel_center_y_direction=0 if y >= 0 else 1,
hotel_center_z_direction=0 if z >= 0 else 1,
clearance_height=round(hotel_clearance_height * 10),
hotel_depth=round(hotel_depth * 10),
grip_direction=pickup.direction,
Expand All @@ -2801,9 +2801,9 @@ async def pick_up_resource(
x_position=round(x * 10),
y_position=round(y * 10),
z_position=round(z * 10),
x_direction=0,
y_direction=0,
z_direction=0,
x_direction=0 if x >= 0 else 1,
y_direction=0 if y >= 0 else 1,
z_direction=0 if z >= 0 else 1,
grip_direction={
GripDirection.FRONT: 1,
GripDirection.RIGHT: 2,
Expand Down Expand Up @@ -2921,9 +2921,12 @@ async def drop_resource(
hotel_open_gripper_position = drop.resource.get_absolute_size_y() + 50

await self.unsafe.put_in_hotel(
hotel_center_x_coord=round(x * 10),
hotel_center_y_coord=round(y * 10),
hotel_center_z_coord=round(z * 10),
hotel_center_x_coord=round(abs(x) * 10),
hotel_center_y_coord=round(abs(y) * 10),
hotel_center_z_coord=round(abs(z) * 10),
hotel_center_x_direction=0 if x >= 0 else 1,
hotel_center_y_direction=0 if y >= 0 else 1,
hotel_center_z_direction=0 if z >= 0 else 1,
clearance_height=round(hotel_clearance_height * 10),
hotel_depth=round(hotel_depth * 10),
grip_direction=drop.direction,
Expand All @@ -2935,12 +2938,12 @@ async def drop_resource(
)
else:
await self.iswap_put_plate(
x_position=round(x * 10),
y_position=round(y * 10),
z_position=round(z * 10),
x_direction=0,
y_direction=0,
z_direction=0,
x_position=round(abs(x) * 10),
y_position=round(abs(y) * 10),
z_position=round(abs(z) * 10),
x_direction=0 if x >= 0 else 1,
y_direction=0 if y >= 0 else 1,
z_direction=0 if z >= 0 else 1,
grip_direction={
GripDirection.FRONT: 1,
GripDirection.RIGHT: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ async def send_raw_command(
) -> Optional[str]:
print(command)
return None

async def request_z_pos_channel_n(self, channel: int) -> float:
return 285.0

0 comments on commit b4ff02c

Please sign in to comment.