支持Biomek创建

This commit is contained in:
Xuwznln
2025-06-05 16:04:44 +08:00
parent 39de3ac58e
commit dd5a7cab75
2 changed files with 491 additions and 481 deletions

View File

@@ -1,7 +1,8 @@
import requests
from typing import List, Sequence, Optional, Union, Literal
from geometry_msgs.msg import Point
#from unilabos_msgs.msg import Resource
from pylabrobot.liquid_handling import LiquidHandler
from unilabos_msgs.msg import Resource
from pylabrobot.resources import (
TipRack,
@@ -22,8 +23,8 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
该类用于处理Biomek液体处理器的特定操作。
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, backend=None, deck=None, *args, **kwargs):
super().__init__(backend, deck, *args, **kwargs)
self._status = "Idle" # 初始状态为 Idle
self._success = False # 初始成功状态为 False
self._status_queue = kwargs.get("status_queue", None) # 状态队列
@@ -71,6 +72,10 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
}
}
@classmethod
def deserialize(cls, data: dict, allow_marshal: bool = False) -> LiquidHandler:
return LiquidHandler.deserialize(data, allow_marshal)
def create_protocol(
self,
@@ -259,7 +264,7 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
}
transfer_params["items"] = items
transfer_params["Solvent"] = solvent if solvent else "Water"
transfer_params["Solvent"] = "Water"
TipLocation = tip_racks[0].name
transfer_params["TipLocation"] = TipLocation
@@ -340,6 +345,9 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
return
if __name__ == "__main__":
steps_info = '''
{
"steps": [

View File

@@ -805,7 +805,9 @@ class ROS2DeviceNode:
self.resource_tracker = DeviceNodeResourceTracker()
# use_pylabrobot_creator 使用 cls的包路径检测
use_pylabrobot_creator = driver_class.__module__.startswith("pylabrobot") or driver_class.__name__ == "LiquidHandlerAbstract"
use_pylabrobot_creator = (driver_class.__module__.startswith("pylabrobot")
or driver_class.__name__ == "LiquidHandlerAbstract"
or driver_class.__name__ == "LiquidHandlerBiomek")
# TODO: 要在创建之前预先请求服务器是否有当前id的物料放到resource_tracker中让pylabrobot进行创建
# 创建设备类实例