Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9b158f8
修改lh的json启动
Sep 26, 2025
8bed8f8
修改lh的json启动
Sep 26, 2025
e425979
Merge branch '3d_sim' of https://github.com/q434343/Uni-Lab-OS into 3…
Sep 26, 2025
a2ed60e
修改backend,做成sim的通用backend
Sep 26, 2025
24d6786
修改yaml的地址,3D模型适配网页生产环境
Sep 28, 2025
6fb9f1a
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Sep 28, 2025
be6f7a5
添加laiyu硬件连接
Sep 30, 2025
553923d
Merge branch 'dev' into pr/97
TablewareBox Sep 30, 2025
a0641bb
Merge branch '3d_sim' of https://github.com/q434343/Uni-Lab-OS into p…
TablewareBox Sep 30, 2025
1c4878f
修改移液枪的状态判断方法,
Oct 14, 2025
05f11b3
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Oct 15, 2025
0733104
修改laiyu移液站
Oct 15, 2025
41e6d69
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Oct 21, 2025
c25c05d
更新lh以及laiyu workshop
Oct 29, 2025
57b1dd9
修改枪头动作
Oct 29, 2025
d1c523c
修改虚拟仿真方法
Nov 13, 2025
2659fb1
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Nov 13, 2025
e52992b
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Nov 17, 2025
afb28b6
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Nov 21, 2025
3b80e45
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Nov 25, 2025
3cc85d9
添加尺寸判定
Nov 28, 2025
830e914
Merge remote-tracking branch 'upstream/dev' into 3d_sim
Nov 28, 2025
161a6fe
添加json启动文件
Nov 29, 2025
e457c5b
Create prcxi_9320_visual copy.json
Nov 29, 2025
82faa5a
修改grapgio
Nov 29, 2025
03ffb1c
添加纯净启动文件
Nov 29, 2025
9847dd1
canonicalize tests/ folder
TablewareBox Nov 29, 2025
f83aab7
refactor resource_tracker
TablewareBox Nov 29, 2025
346d7dd
添加返回数值
Nov 30, 2025
bdff0c6
Merge branch 'commit' of https://github.com/q434343/Uni-Lab-OS into c…
Nov 30, 2025
68f22b0
修改prcxi的liquid_handling,
Nov 30, 2025
280ad6d
Merge remote-tracking branch 'upstream/dev' into commit
Dec 1, 2025
af19722
删除徕羽部分测试代码
Dec 2, 2025
0ebe509
Merge remote-tracking branch 'upstream/dev' into commit
Dec 2, 2025
51db6d4
Revert "删除徕羽部分测试代码"
Dec 2, 2025
3491479
Reapply "删除徕羽部分测试代码"
Dec 2, 2025
6b96fd1
Revert "Merge remote-tracking branch 'upstream/dev' into commit"
Dec 2, 2025
b9d94de
Reapply "Merge remote-tracking branch 'upstream/dev' into commit"
Dec 2, 2025
b5aa931
Revert "signal when host node is ready"
Dec 2, 2025
fd68194
Revert "Fix startup with remote resource error"
Dec 2, 2025
ad8e9cd
dump example files back to unilabos/test
TablewareBox Dec 23, 2025
68abc02
Merge branch 'dev' into pr/178
TablewareBox Dec 23, 2025
4766cae
clean up files
TablewareBox Dec 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions unilabos/devices/liquid_handling/liquid_handler_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, backend: LiquidHandlerBackend, deck: Deck, simulator: bool =
else:
self._simulate_backend = LiquidHandlerChatterboxBackend(channel_num)
self._simulate_handler = LiquidHandlerAbstract(self._simulate_backend, deck, False)

super().__init__(backend, deck)

async def setup(self, **backend_kwargs):
Expand Down Expand Up @@ -549,16 +550,51 @@ class LiquidHandlerAbstract(LiquidHandlerMiddleware):
support_touch_tip = True
_ros_node: BaseROS2DeviceNode

def __init__(self, backend: LiquidHandlerBackend, deck: Deck, simulator: bool=False, channel_num:int = 8):
def __init__(self, backend: LiquidHandlerBackend, deck: Deck, simulator: bool=False, channel_num:int = 8,**backend_kwargs):
"""Initialize a LiquidHandler.

Args:
backend: Backend to use.
deck: Deck to use.
"""
backend_type = None
if isinstance(backend, dict) and "type" in backend:
backend_dict = backend.copy()
type_str = backend_dict.pop("type")
try:
# Try to get class from string using globals (current module), or fallback to pylabrobot or unilabos namespaces
backend_cls = None
if type_str in globals():
backend_cls = globals()[type_str]
else:
# Try resolving dotted notation, e.g. "xxx.yyy.ClassName"
components = type_str.split(".")
mod = None
if len(components) > 1:
module_name = ".".join(components[:-1])
try:
import importlib
mod = importlib.import_module(module_name)
except ImportError:
mod = None
if mod is not None:
backend_cls = getattr(mod, components[-1], None)
if backend_cls is None:
# Try pylabrobot style import (if available)
try:
import pylabrobot
backend_cls = getattr(pylabrobot, type_str, None)
except Exception:
backend_cls = None
if backend_cls is not None and isinstance(backend_cls, type):
backend_type = backend_cls(**backend_dict) # pass the rest of dict as kwargs
except Exception as exc:
raise RuntimeError(f"Failed to convert backend type '{type_str}' to class: {exc}")
else:
backend_type = backend
self._simulator = simulator
self.group_info = dict()
super().__init__(backend, deck, simulator, channel_num)
super().__init__(backend_type, deck, simulator, channel_num,**backend_kwargs)

def post_init(self, ros_node: BaseROS2DeviceNode):
self._ros_node = ros_node
Expand Down
34 changes: 32 additions & 2 deletions unilabos/devices/liquid_handling/prcxi/prcxi.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,37 @@ class PRCXI9300Deck(Deck):

def __init__(self, name: str, size_x: float, size_y: float, size_z: float, **kwargs):
super().__init__(name, size_x, size_y, size_z)
self.slots = [None] * 6 # PRCXI 9300 有 6 个槽位

self.slots = [None] * 12 # PRCXI 9300 有 6 个槽位
self.slot_locations = [
Coordinate(x=0.0, y=0.0, z=0.0),
Coordinate(x=132.5, y=0.0, z=0.0),
Coordinate(x=265.0, y=0.0, z=0.0),
Coordinate(x=0.0, y=90.5, z=0.0),
Coordinate(x=132.5, y=90.5, z=0.0),
Coordinate(x=265.0, y=90.5, z=0.0),
Coordinate(x=0.0, y=181.0, z=0.0),
Coordinate(x=132.5, y=181.0, z=0.0),
Coordinate(x=265.0, y=181.0, z=0.0),
Coordinate(x=0.0, y=271.5, z=0.0),
Coordinate(x=132.5, y=271.5, z=0.0),
Coordinate(x=265.0, y=271.5, z=0.0),
]

def serialize(self):
super_serialized = super().serialize()
if hasattr(self, "slot_locations"):
super_serialized["sites"] = [
{
"label": str(i),
"visible": True,
"position": {"x": slot.x, "y": slot.y, "z": slot.z},
"size": {"width": 127.0, "height": 85.5, "depth":0},
"content_type": ["plate", "tip_rack", "tube_rack"],
} for i, slot in enumerate(self.slot_locations)
]
print("----"*10)
print(super_serialized)
return super_serialized

class PRCXI9300Container(Plate, TipRack):
"""PRCXI 9300 的专用 Container 类,继承自 Plate和TipRack。
Expand Down Expand Up @@ -149,6 +178,7 @@ def __init__(
step_mode=False,
matrix_id="",
is_9320=False,
**kwargs,
):
tablets_info = []
count = 0
Expand Down
11 changes: 7 additions & 4 deletions unilabos/registry/devices/laiyu_liquid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,8 @@ laiyu_liquid:
mix_liquid_height: 0.0
mix_rate: 0
mix_stage: ''
mix_times: 0
mix_times:
- 0
mix_vol: 0
none_keys:
- ''
Expand Down Expand Up @@ -1491,9 +1492,11 @@ laiyu_liquid:
mix_stage:
type: string
mix_times:
maximum: 2147483647
minimum: -2147483648
type: integer
items:
maximum: 2147483647
minimum: -2147483648
type: integer
type: array
mix_vol:
maximum: 2147483647
minimum: -2147483648
Expand Down
35 changes: 23 additions & 12 deletions unilabos/registry/devices/liquid_handler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4019,7 +4019,8 @@ liquid_handler:
mix_liquid_height: 0.0
mix_rate: 0
mix_stage: ''
mix_times: 0
mix_times:
- 0
mix_vol: 0
none_keys:
- ''
Expand Down Expand Up @@ -4175,9 +4176,11 @@ liquid_handler:
mix_stage:
type: string
mix_times:
maximum: 2147483647
minimum: -2147483648
type: integer
items:
maximum: 2147483647
minimum: -2147483648
type: integer
type: array
mix_vol:
maximum: 2147483647
minimum: -2147483648
Expand Down Expand Up @@ -5037,7 +5040,8 @@ liquid_handler.biomek:
mix_liquid_height: 0.0
mix_rate: 0
mix_stage: ''
mix_times: 0
mix_times:
- 0
mix_vol: 0
none_keys:
- ''
Expand Down Expand Up @@ -5180,9 +5184,11 @@ liquid_handler.biomek:
mix_stage:
type: string
mix_times:
maximum: 2147483647
minimum: -2147483648
type: integer
items:
maximum: 2147483647
minimum: -2147483648
type: integer
type: array
mix_vol:
maximum: 2147483647
minimum: -2147483648
Expand Down Expand Up @@ -8876,6 +8882,8 @@ liquid_handler.prcxi:
type: ''
handles: {}
placeholder_keys:
liquid_names: unilabos_resource_names
volumes: unilabos_resource_amounts
wells: unilabos_resources
result: {}
schema:
Expand Down Expand Up @@ -9261,7 +9269,8 @@ liquid_handler.prcxi:
mix_liquid_height: 0.0
mix_rate: 0
mix_stage: ''
mix_times: 0
mix_times:
- 0
mix_vol: 0
none_keys:
- ''
Expand Down Expand Up @@ -9390,9 +9399,11 @@ liquid_handler.prcxi:
mix_stage:
type: string
mix_times:
maximum: 2147483647
minimum: -2147483648
type: integer
items:
maximum: 2147483647
minimum: -2147483648
type: integer
type: array
mix_vol:
maximum: 2147483647
minimum: -2147483648
Expand Down
60 changes: 60 additions & 0 deletions unilabos/registry/resources/common/resource_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ hplc_plate:
init_param_schema: {}
model:
mesh: hplc_plate/meshes/hplc_plate.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/hplc_plate/modal.xacro
mesh_tf:
- 0
- 0
Expand Down Expand Up @@ -126,6 +127,7 @@ plate_96_high:
init_param_schema: {}
model:
mesh: plate_96_high/meshes/plate_96_high.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/plate_96_high/modal.xacro
mesh_tf:
- 0
- 0.086
Expand Down Expand Up @@ -186,6 +188,7 @@ tiprack_96_high:
- 0
- 0
mesh: tiprack_96_high/meshes/tiprack_96_high.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/tiprack_96_high/modal.xacro
mesh_tf:
- 0
- 0.086
Expand Down Expand Up @@ -229,3 +232,60 @@ tiprack_box:
type: resource
registry_type: resource
version: 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The tiprack_box entry is defined twice, which in YAML means the earlier definition is silently overwritten.

Because YAML keeps only the last value for a given key, this new tiprack_box block will replace the earlier one entirely. Please confirm whether you meant to fully replace it; otherwise, consider renaming this resource or merging these fields into the original definition so existing configuration isn’t lost.


tiprack_box:
category:
- resource_container
class:
module: unilabos.devices.resource_container.container:TipRackContainer
type: python
description: 96针头盒
handles: []
icon: ''
init_param_schema: {}
model:
children_mesh: tip/meshes/tip.stl
children_mesh_path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/tip/modal.xacro
children_mesh_tf:
- 0.0045
- 0.0045
- 0
- 0
- 0
- 0
mesh: tiprack_box/meshes/tiprack_box.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/tiprack_box/modal.xacro
mesh_tf:
- 0
- 0
- 0
- 0
- 0
- 0
type: resource
registry_type: resource
version: 1.0.0

plate_96:
category:
- resource_container
class:
module: unilabos.devices.resource_container.container:PlateContainer
type: python
description: 96孔板
handles: []
icon: ''
init_param_schema: {}
model:
mesh: plate_96/meshes/plate_96.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/plate_96/modal.xacro
mesh_tf:
- 0
- 0
- 0
- 0
- 0
- 0
type: resource
registry_type: resource
version: 1.0.0
18 changes: 18 additions & 0 deletions unilabos/registry/resources/laiyu/deck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,21 @@ TransformXYZDeck:
type: device
registry_type: resource
version: 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The TransformXYZDeck resource is declared twice, so the second definition will override the first.

Because YAML only keeps the last occurrence of a duplicate top-level key, the earlier TransformXYZDeck definition will be silently discarded. If you meant to extend or modify the existing resource, please merge these fields into the original block rather than redefining the key, so you don’t lose any configuration from the first definition.


TransformXYZDeck:
category:
- deck
class:
module: unilabos.devices.liquid_handling.laiyu.laiyu:TransformXYZDeck
type: pylabrobot
description: Laiyu deck
handles: []
icon: ''
init_param_schema: {}
model:
mesh: liquid_transform_xyz
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/devices/liquid_transform_xyz/macro_device.xacro
type: device
registry_type: resource
version: 1.0.0

2 changes: 2 additions & 0 deletions unilabos/registry/resources/opentrons/plates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ nest_96_wellplate_100ul_pcr_full_skirt:
- 0
- 0
mesh: tecan_nested_tip_rack/meshes/plate.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/tecan_nested_tip_rack/modal.xacro
mesh_tf:
- 0.064
- 0.043
Expand Down Expand Up @@ -162,6 +163,7 @@ nest_96_wellplate_2ml_deep:
init_param_schema: {}
model:
mesh: tecan_nested_tip_rack/meshes/plate.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/tecan_nested_tip_rack/modal.xacro
mesh_tf:
- 0.064
- 0.043
Expand Down
1 change: 1 addition & 0 deletions unilabos/registry/resources/opentrons/tip_racks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ opentrons_96_filtertiprack_1000ul:
- 0
- 0
mesh: tecan_nested_tip_rack/meshes/plate.stl
path: https://uni-lab.oss-cn-zhangjiakou.aliyuncs.com/uni-lab/resources/tecan_nested_tip_rack/modal.xacro
mesh_tf:
- 0.064
- 0.043
Expand Down
2 changes: 1 addition & 1 deletion unilabos/registry/resources/prcxi/plates.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prcxi_96_wellplate_360ul_flat:
category:
- plates
- plate
class:
module: unilabos.devices.liquid_handling.prcxi.prcxi_res:prcxi_96_wellplate_360ul_flat
type: pylabrobot
Expand Down
5 changes: 2 additions & 3 deletions unilabos/registry/resources/prcxi/tip_racks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prcxi_opentrons_96_tiprack_10ul:
category:
- tip_racks
- tip_rack
class:
module: unilabos.devices.liquid_handling.prcxi.prcxi_res:prcxi_opentrons_96_tiprack_10ul
type: pylabrobot
Expand All @@ -12,8 +12,7 @@ prcxi_opentrons_96_tiprack_10ul:
version: 1.0.0
tip_adaptor_1250ul_2:
category:
- prcxi
- tip_racks
- tip_rack
class:
module: unilabos.devices.liquid_handling.prcxi.prcxi_materials:tip_adaptor_1250ul
type: pylabrobot
Expand Down
Loading
Loading