diff --git a/unilabos/compile/add_protocol.py b/unilabos/compile/add_protocol.py index c492d238..fbb264a2 100644 --- a/unilabos/compile/add_protocol.py +++ b/unilabos/compile/add_protocol.py @@ -169,7 +169,7 @@ def generate_add_protocol( # 固体加样 add_kwargs = { - "vessel": vessel_id, # 🔧 使用 vessel_id + "vessel": {"id": vessel_id}, # 🔧 使用 vessel_id "reagent": reagent, "purpose": purpose, "event": event, diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index 70bde938..a7286e97 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -636,11 +636,8 @@ class HostNode(BaseROS2DeviceNode): 向设备发送目标请求 Args: - device_id: 设备ID action_type: 动作类型 - action_name: 动作名称 action_kwargs: 动作参数 - goal_uuid: 目标UUID,如果为None则自动生成 server_info: 服务器发送信息,包含发送时间戳等 """ u = uuid.UUID(item.job_id) diff --git a/unilabos/ros/nodes/presets/protocol_node.py b/unilabos/ros/nodes/presets/protocol_node.py index 25b9c11a..02e6674e 100644 --- a/unilabos/ros/nodes/presets/protocol_node.py +++ b/unilabos/ros/nodes/presets/protocol_node.py @@ -191,12 +191,11 @@ class ROS2ProtocolNode(BaseROS2DeviceNode): execution_error = "" execution_success = False protocol_return_value = None - self.get_logger().info(f"Executing {protocol_name} action...") + self.lab_logger().info(f"Executing {protocol_name} action...") action_value_mapping = self._action_value_mappings[protocol_name] step_results = [] try: - print("+" * 30) - print(protocol_steps_generator) + self.lab_logger().warning("+" * 30) # 从目标消息中提取参数, 并调用Protocol生成器(根据设备连接图)生成action步骤 goal = goal_handle.request protocol_kwargs = convert_from_ros_msg_with_mapping(goal, action_value_mapping["goal"]) diff --git a/unilabos/ros/utils/driver_creator.py b/unilabos/ros/utils/driver_creator.py index 2d035be1..b1b718f6 100644 --- a/unilabos/ros/utils/driver_creator.py +++ b/unilabos/ros/utils/driver_creator.py @@ -284,9 +284,6 @@ class ProtocolNodeCreator(DeviceClassCreator[T]): """ super().__init__(cls, children, resource_tracker) - def attach_resource(self): - pass # WorkstationNode不直接附加资源 - def create_instance(self, data: Dict[str, Any]) -> T: """ 从数据创建ProtocolNode设备实例