From 33285746239e287a9a52105cae53f3fcae6817af Mon Sep 17 00:00:00 2001 From: Camillo Moschner Date: Wed, 4 Feb 2026 00:29:40 +0000 Subject: [PATCH 1/2] Resize `STAR(let)Deck.size_x` (with trash maintenance) --- pylabrobot/resources/deck.py | 2 +- .../resources/hamilton/hamilton_decks.py | 43 +++++++++---------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/pylabrobot/resources/deck.py b/pylabrobot/resources/deck.py index 8d87afa261b..a3221b29949 100644 --- a/pylabrobot/resources/deck.py +++ b/pylabrobot/resources/deck.py @@ -21,7 +21,7 @@ class Deck(Resource): def __init__( self, name: str = "deck", - size_x: float = 1360, + size_x: float = 1005, size_y: float = 653.5, size_z: float = 900, origin: Coordinate = Coordinate(0, 0, 0), diff --git a/pylabrobot/resources/hamilton/hamilton_decks.py b/pylabrobot/resources/hamilton/hamilton_decks.py index 5e35b298b5c..2d6027db1a9 100644 --- a/pylabrobot/resources/hamilton/hamilton_decks.py +++ b/pylabrobot/resources/hamilton/hamilton_decks.py @@ -19,12 +19,12 @@ _RAILS_WIDTH = 22.5 # space between rails (mm) STARLET_NUM_RAILS = 32 -STARLET_SIZE_X = 1360 +STARLET_SIZE_X = 1005 STARLET_SIZE_Y = 653.5 STARLET_SIZE_Z = 900 STAR_NUM_RAILS = 56 -STAR_SIZE_X = 1900 +STAR_SIZE_X = 1545 STAR_SIZE_Y = 653.5 STAR_SIZE_Z = 900 @@ -170,7 +170,7 @@ def assign_child_resource( def should_check_collision(res: Resource) -> bool: """Determine if collision detection should be performed for this resource.""" - if isinstance(res, HamiltonCoreGrippers): + if isinstance(res, (HamiltonCoreGrippers, Trash)): return False return True @@ -437,6 +437,7 @@ def __init__( name="deck", category: str = "deck", origin: Coordinate = Coordinate.zero(), + with_waste_block: bool = True, with_trash: bool = True, with_trash96: bool = True, with_teaching_rack: bool = True, @@ -456,17 +457,6 @@ def __init__( origin=origin, ) - # assign trash area - if with_trash: - trash_x = ( - size_x - 560 - ) # only tested on STARLet, assume STAR is same distance from right max.. - - self.assign_child_resource( - resource=Trash("trash", size_x=0, size_y=241.2, size_z=0), - location=Coordinate(x=trash_x, y=190.6, z=137.1), - ) # z I am not sure about - self._trash96: Optional[Trash] = None if with_trash96: # got this location from a .lay file, but will probably need to be adjusted by the user. @@ -476,8 +466,14 @@ def __init__( location=Coordinate(x=-42.0 - 16.2, y=120.3 - 14.3, z=216.4), ) - if with_teaching_rack: + if with_waste_block: waste_block = Resource(name="waste_block", size_x=30, size_y=445.2, size_z=100) + self.assign_child_resource( + waste_block, + location=Coordinate(x=self.rails_to_location(self.num_rails - 1).x, y=115.0, z=100), + ) + + if with_teaching_rack: tip_spots = [ TipSpot( name=f"tip_spot_{i}", @@ -501,15 +497,15 @@ def __init__( model="hamilton_teaching_tip_rack", ) waste_block.assign_child_resource(teaching_tip_rack, location=Coordinate(x=5.9, y=346.1, z=0)) - self.assign_child_resource( - waste_block, - location=Coordinate(x=self.rails_to_location(self.num_rails - 1).x, y=115.0, z=100), - ) - if core_grippers is not None and not with_teaching_rack: - raise ValueError( - "core_grippers can only be added when with_teaching_rack is True, " - "as they are attached to the waste block." + # assign trash area, positioned 25mm to the right of the waste block + if with_trash: + waste_block_x = self.get_resource("waste_block").get_location_wrt(self).x + trash_x = waste_block_x + 25 + + self.assign_child_resource( + resource=Trash("trash", size_x=0, size_y=241.2, size_z=0), + location=Coordinate(x=trash_x, y=190.6, z=137.1), ) if core_grippers == "1000uL-at-waste": # "at waste" @@ -530,6 +526,7 @@ def __init__( def serialize(self) -> dict: return { **super().serialize(), + "with_waste_block": False, # data encoded as child. (not very pretty to have this key though...) "with_teaching_rack": False, # data encoded as child. (not very pretty to have this key though...) "core_grippers": None, # data encoded as child. (not very pretty to have this key though...) } From e37c5b2a58a89d0d583dbe33ff3b64575500dafe Mon Sep 17 00:00:00 2001 From: Camillo Moschner <122165124+BioCam@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:07:56 +0000 Subject: [PATCH 2/2] Update pylabrobot/resources/hamilton/hamilton_decks.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pylabrobot/resources/hamilton/hamilton_decks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pylabrobot/resources/hamilton/hamilton_decks.py b/pylabrobot/resources/hamilton/hamilton_decks.py index 2d6027db1a9..7df0e1b890b 100644 --- a/pylabrobot/resources/hamilton/hamilton_decks.py +++ b/pylabrobot/resources/hamilton/hamilton_decks.py @@ -500,7 +500,11 @@ def __init__( # assign trash area, positioned 25mm to the right of the waste block if with_trash: - waste_block_x = self.get_resource("waste_block").get_location_wrt(self).x + if with_waste_block: + waste_block_x = self.get_resource("waste_block").get_location_wrt(self).x + else: + # Fallback: anchor to the rightmost rail when no waste block is present. + waste_block_x = self.rails_to_location(self.num_rails - 1).x trash_x = waste_block_x + 25 self.assign_child_resource(