diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index feba3fef..a4ef581c 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -20,7 +20,40 @@ class Registry: self.registry_paths = DEFAULT_PATHS.copy() # 使用copy避免修改默认值 if registry_paths: self.registry_paths.extend(registry_paths) - self.device_type_registry = {} + action_type = self._replace_type_with_class( + "ResourceCreateFromOuter", "host_node", f"动作 add_resource_from_outer" + ) + schema = ros_action_to_json_schema(action_type) + self.device_type_registry = { + "host_node": { + "description": "UniLabOS主机节点", + "class": { + "module": "unilabos.ros.nodes.presets.host_node", + "type": "python", + "status_types": {}, + "action_value_mappings": { + "add_resource_from_outer": { + "type": msg_converter_manager.search_class("ResourceCreateFromOuter"), + "goal": { + "resources": "resources", + "device_ids": "device_ids", + }, + "feedback": {}, + "result": { + "success": "success" + }, + "schema": schema + } + } + }, + "schema": { + "properties": {}, + "additionalProperties": False, + "type": "object" + }, + "file_path": "/" + } + } self.resource_type_registry = {} self._setup_called = False # 跟踪setup是否已调用 # 其他状态变量 diff --git a/unilabos_msgs/CMakeLists.txt b/unilabos_msgs/CMakeLists.txt index c67353be..69fbaa3a 100644 --- a/unilabos_msgs/CMakeLists.txt +++ b/unilabos_msgs/CMakeLists.txt @@ -55,7 +55,7 @@ set(action_files "action/EmptyIn.action" "action/FloatSingleInput.action" "action/IntSingleInput.action" - "action/IntSingleOutput.action" + "action/StrSingleInput.action" "action/Point3DSeparateInput.action" "action/ResourceCreateFromOuter.action"