From ccf1cdc23fb8b769645fd642d4bea40c96bee9ff Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Fri, 1 Aug 2025 01:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E5=86=8C=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unilabos/registry/devices/robot_arm.yaml | 204 +++++++++++++++++- unilabos/registry/registry.py | 7 +- .../resources/common/resource_container.yaml | 89 +++++--- .../registry/resources/opentrons/deck.yaml | 16 +- 4 files changed, 270 insertions(+), 46 deletions(-) diff --git a/unilabos/registry/devices/robot_arm.yaml b/unilabos/registry/devices/robot_arm.yaml index f85d231..64b7344 100644 --- a/unilabos/registry/devices/robot_arm.yaml +++ b/unilabos/registry/devices/robot_arm.yaml @@ -147,7 +147,6 @@ robotic_arm.UR: handles: [] icon: '' init_param_schema: - additionalProperties: false config: properties: host: @@ -173,13 +172,189 @@ robotic_arm.UR: - gripper_pose - arm_status - gripper_status - type: object + type: object version: 1.0.0 robotic_arm.elite: category: - robot_arm class: action_value_mappings: + auto-close: + feedback: {} + goal: {} + goal_default: {} + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: {} + required: [] + type: object + result: {} + required: + - goal + title: close参数 + type: object + type: UniLabJsonCommand + auto-modbus_close: + feedback: {} + goal: {} + goal_default: {} + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: {} + required: [] + type: object + result: {} + required: + - goal + title: modbus_close参数 + type: object + type: UniLabJsonCommand + auto-modbus_read_holding_registers: + feedback: {} + goal: {} + goal_default: + quantity: null + start_addr: null + unit_id: null + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: + quantity: + type: string + start_addr: + type: string + unit_id: + type: string + required: + - unit_id + - start_addr + - quantity + type: object + result: {} + required: + - goal + title: modbus_read_holding_registers参数 + type: object + type: UniLabJsonCommand + auto-modbus_task: + feedback: {} + goal: {} + goal_default: + job_id: null + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: + job_id: + type: string + required: + - job_id + type: object + result: {} + required: + - goal + title: modbus_task参数 + type: object + type: UniLabJsonCommand + auto-modbus_write_single_register: + feedback: {} + goal: {} + goal_default: + register_addr: null + unit_id: null + value: null + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: + register_addr: + type: string + unit_id: + type: string + value: + type: string + required: + - unit_id + - register_addr + - value + type: object + result: {} + required: + - goal + title: modbus_write_single_register参数 + type: object + type: UniLabJsonCommand + auto-parse_success_response: + feedback: {} + goal: {} + goal_default: + response: null + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: + response: + type: string + required: + - response + type: object + result: {} + required: + - goal + title: parse_success_response参数 + type: object + type: UniLabJsonCommand + auto-send_command: + feedback: {} + goal: {} + goal_default: + command: null + handles: [] + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: + command: + type: string + required: + - command + type: object + result: {} + required: + - goal + title: send_command参数 + type: object + type: UniLabJsonCommand modbus_task_cmd: feedback: {} goal: @@ -225,13 +400,34 @@ robotic_arm.elite: type: SendCmd module: unilabos.devices.arm.elite_robot:EliteRobot status_types: - arm_pose: Float64MultiArray + actual_joint_positions: String + arm_pose: list type: python config_info: [] description: Elite robot arm handles: [] icon: '' - init_param_schema: {} + init_param_schema: + config: + properties: + device_id: + type: string + host: + type: string + required: + - device_id + - host + type: object + data: + properties: + actual_joint_positions: + type: string + arm_pose: + type: array + required: + - arm_pose + - actual_joint_positions + type: object model: mesh: elite_robot type: device diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index b0cc756..e173652 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -180,7 +180,6 @@ class Registry: if data: # 为每个资源添加文件路径信息 for resource_id, resource_info in data.items(): - resource_info["file_path"] = str(file.absolute()).replace("\\", "/") if "version" not in resource_info: resource_info["version"] = "1.0.0" if "category" not in resource_info: @@ -206,9 +205,9 @@ class Registry: res_instance = res_class(res_class.__name__) res_ulr = tree_to_list([resource_plr_to_ulab(res_instance)]) resource_info["config_info"] = res_ulr - resource_info["registry_type"] = "resource" complete_data[resource_id] = copy.deepcopy(dict(sorted(resource_info.items()))) # 稍后dump到文件 - + resource_info["registry_type"] = "resource" + resource_info["file_path"] = str(file.absolute()).replace("\\", "/") complete_data = dict(sorted(complete_data.items())) complete_data = copy.deepcopy(complete_data) if complete_registry: @@ -564,8 +563,6 @@ class Registry: ), "handles": {}, } - if "registry_type" not in device_config: - device_config["registry_type"] = "device" device_config["file_path"] = str(file.absolute()).replace("\\", "/") device_config["registry_type"] = "device" logger.debug( diff --git a/unilabos/registry/resources/common/resource_container.yaml b/unilabos/registry/resources/common/resource_container.yaml index 2c1e9c0..e689e27 100644 --- a/unilabos/registry/resources/common/resource_container.yaml +++ b/unilabos/registry/resources/common/resource_container.yaml @@ -1,27 +1,16 @@ -plate_96_high: - description: 96孔板 - class: - module: unilabos.devices.resource_container.container:PlateContainer - type: python - model: - type: resource - mesh: plate_96_high/meshes/plate_96_high.stl - mesh_tf: - - 0 - - 0.086 - - 0 - - 1.5708 - - 0 - - 1.5708 - - hplc_plate: - description: HPLC板 - class: + category: + - resource_container + class: module: unilabos.devices.resource_container.container:PlateContainer type: python + config_info: [] + description: HPLC板 + file_path: C:/Users/10230/PycharmProjects/Uni-Lab-OS/unilabos/registry/resources/common/resource_container.yaml + handles: [] + icon: '' + init_param_schema: {} model: - type: resource mesh: hplc_plate/meshes/hplc_plate.stl mesh_tf: - 0 @@ -30,15 +19,54 @@ hplc_plate: - 0 - 0 - 3.1416 - - -tiprack_96_high: + type: resource + registry_type: resource + version: 1.0.0 +plate_96_high: + category: + - resource_container + class: + module: unilabos.devices.resource_container.container:PlateContainer + type: python + config_info: [] description: 96孔板 - class: + file_path: C:/Users/10230/PycharmProjects/Uni-Lab-OS/unilabos/registry/resources/common/resource_container.yaml + handles: [] + icon: '' + init_param_schema: {} + model: + mesh: plate_96_high/meshes/plate_96_high.stl + mesh_tf: + - 0 + - 0.086 + - 0 + - 1.5708 + - 0 + - 1.5708 + type: resource + registry_type: resource + version: 1.0.0 +tiprack_96_high: + category: + - resource_container + class: module: unilabos.devices.resource_container.container:TipRackContainer type: python + config_info: [] + description: 96孔板 + file_path: C:/Users/10230/PycharmProjects/Uni-Lab-OS/unilabos/registry/resources/common/resource_container.yaml + handles: [] + icon: '' + init_param_schema: {} model: - type: resource + children_mesh: generic_labware_tube_10_75/meshes/0_base.stl + children_mesh_tf: + - 0.0018 + - 0.0018 + - -0.03 + - -1.5708 + - 0 + - 0 mesh: tiprack_96_high/meshes/tiprack_96_high.stl mesh_tf: - 0 @@ -47,11 +75,6 @@ tiprack_96_high: - 1.5708 - 0 - 1.5708 - children_mesh: generic_labware_tube_10_75/meshes/0_base.stl - children_mesh_tf: - - 0.0018 - - 0.0018 - - -0.03 - - -1.5708 - - 0 - - 0 \ No newline at end of file + type: resource + registry_type: resource + version: 1.0.0 diff --git a/unilabos/registry/resources/opentrons/deck.yaml b/unilabos/registry/resources/opentrons/deck.yaml index 4170cd0..bea7b2d 100644 --- a/unilabos/registry/resources/opentrons/deck.yaml +++ b/unilabos/registry/resources/opentrons/deck.yaml @@ -15,12 +15,20 @@ OTDeck: type: device registry_type: resource version: 1.0.0 - hplc_station: - description: hplc_station deck - class: + category: + - deck + class: module: unilabos.devices.resource_container.container:DeckContainer type: python + config_info: [] + description: hplc_station deck + file_path: C:/Users/10230/PycharmProjects/Uni-Lab-OS/unilabos/registry/resources/opentrons/deck.yaml + handles: [] + icon: '' + init_param_schema: {} model: + mesh: hplc_station type: device - mesh: hplc_station \ No newline at end of file + registry_type: resource + version: 1.0.0