diff --git a/unilabos/registry/devices/liquid_handler.yaml b/unilabos/registry/devices/liquid_handler.yaml index 7e6e781..a901959 100644 --- a/unilabos/registry/devices/liquid_handler.yaml +++ b/unilabos/registry/devices/liquid_handler.yaml @@ -4388,11 +4388,11 @@ liquid_handler: deck: type: string simulator: + default: false type: boolean required: - backend - deck - - simulator type: object data: properties: {} diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index d7b292c..18916a2 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -110,7 +110,7 @@ class Registry: "placeholder_keys": { "res_id": "unilabos_resources", # 将当前实验室的全部物料id作为下拉框可选择 "device_id": "unilabos_devices", # 将当前实验室的全部设备id作为下拉框可选择 - "parent": "unilabos_resources", # 将当前实验室的全部物料id作为下拉框可选择 + "parent": "unilabos_nodes", # 将当前实验室的设备/物料作为下拉框可选择 }, }, "test_latency": { diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index 8356563..eb5c2bb 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -364,7 +364,16 @@ class HostNode(BaseROS2DeviceNode): resources, device_ids, bind_parent_ids, bind_locations, other_calling_params ): # 这里要求device_id传入必须是edge_device_id - namespace = "/devices/" + device_id + if device_id not in self.devices_names: + self.lab_logger().error(f"[Host Node] Device {device_id} not found in devices_names. Create resource failed.") + raise ValueError(f"[Host Node] Device {device_id} not found in devices_names. Create resource failed.") + + device_key = f"{self.devices_names[device_id]}/{device_id}" + if device_key not in self._online_devices: + self.lab_logger().error(f"[Host Node] Device {device_key} is offline. Create resource failed.") + raise ValueError(f"[Host Node] Device {device_key} is offline. Create resource failed.") + + namespace = self.devices_names[device_id] srv_address = f"/srv{namespace}/append_resource" sclient = self.create_client(SerialCommand, srv_address) sclient.wait_for_service() diff --git a/unilabos/ros/nodes/presets/protocol_node.py b/unilabos/ros/nodes/presets/protocol_node.py index 33fa0d7..6f491c7 100644 --- a/unilabos/ros/nodes/presets/protocol_node.py +++ b/unilabos/ros/nodes/presets/protocol_node.py @@ -112,6 +112,8 @@ class ROS2ProtocolNode(BaseROS2DeviceNode): f"添加了{write}方法(来源:{name} {communicate_hardware_info['read']})" ) + self.lab_logger().info(f"ROS2ProtocolNode {device_id} initialized with protocols: {self.protocol_names}") + def _setup_protocol_names(self, protocol_type): # 处理协议类型 if isinstance(protocol_type, str):