mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
@@ -7,7 +7,7 @@ from typing import Any
|
||||
import yaml
|
||||
|
||||
from unilabos.utils import logger
|
||||
from unilabos.ros.msgs.message_converter import msg_converter_manager
|
||||
from unilabos.ros.msgs.message_converter import msg_converter_manager, ros_action_to_json_schema
|
||||
from unilabos.utils.decorator import singleton
|
||||
from unilabos.utils.type_check import TypeEncoder
|
||||
|
||||
@@ -131,6 +131,7 @@ class Registry:
|
||||
action_config["type"] = self._replace_type_with_class(
|
||||
action_config["type"], device_id, f"动作 {action_name}"
|
||||
)
|
||||
action_config["schema"] = ros_action_to_json_schema(action_config["type"])
|
||||
|
||||
self.device_type_registry.update(data)
|
||||
|
||||
@@ -150,11 +151,7 @@ class Registry:
|
||||
for device_id, device_info in self.device_type_registry.items():
|
||||
msg = {
|
||||
"id": device_id,
|
||||
"name": device_info.get("name", "未命名"),
|
||||
"file_path": device_info.get("file_path", ""),
|
||||
"class_json": json.dumps(
|
||||
device_info.get("class", {}), indent=4, ensure_ascii=False, cls=TypeEncoder
|
||||
),
|
||||
**device_info
|
||||
}
|
||||
devices.append(msg)
|
||||
return devices
|
||||
|
||||
Reference in New Issue
Block a user