diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index 07667f99..331eaf67 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -51,11 +51,14 @@ class Registry: "add_resource_from_outer_easy": { "type": msg_converter_manager.search_class("ResourceCreateFromOuterEasy"), "goal": { - "resources": "resources", - "device_ids": "device_ids", - "bind_parent_ids": "bind_parent_ids", + "res_id": "res_id", + "class_name": "class_name", + "parent": "parent", "bind_locations": "bind_locations", - "other_calling_params": "other_calling_params", + "liquid_input_slot": "liquid_input_slot", + "liquid_type": "liquid_type", + "liquid_volume": "liquid_volume", + "slot_on_deck": "slot_on_deck", }, "feedback": {}, "result": { diff --git a/unilabos/ros/msgs/message_converter.py b/unilabos/ros/msgs/message_converter.py index 4f85a113..e1659e1a 100644 --- a/unilabos/ros/msgs/message_converter.py +++ b/unilabos/ros/msgs/message_converter.py @@ -574,6 +574,7 @@ basic_type_map = { 'int64': {'type': 'integer'}, 'uint64': {'type': 'integer', 'minimum': 0}, 'double': {'type': 'number'}, + 'float': {'type': 'number'}, 'float32': {'type': 'number'}, 'float64': {'type': 'number'}, 'string': {'type': 'string'}, diff --git a/unilabos/ros/nodes/base_device_node.py b/unilabos/ros/nodes/base_device_node.py index ca244206..0fd13c45 100644 --- a/unilabos/ros/nodes/base_device_node.py +++ b/unilabos/ros/nodes/base_device_node.py @@ -515,7 +515,7 @@ class BaseROS2DeviceNode(Node, Generic[T]): action_kwargs = convert_from_ros_msg_with_mapping(goal, action_value_mapping["goal"]) self.lab_logger().debug(f"接收到原始目标: {action_kwargs}") # 向Host查询物料当前状态,如果是host本身的增加物料的请求,则直接跳过 - if action_name != "add_resource_from_outer": + if action_name not in ["add_resource_from_outer", "add_resource_from_outer_easy"]: for k, v in goal.get_fields_and_field_types().items(): if v in ["unilabos_msgs/Resource", "sequence"]: self.lab_logger().info(f"查询资源状态: Key: {k} Type: {v}") @@ -614,7 +614,7 @@ class BaseROS2DeviceNode(Node, Generic[T]): del future # 向Host更新物料当前状态 - if action_name != "add_resource_from_outer": + if action_name not in ["add_resource_from_outer", "add_resource_from_outer_easy"]: for k, v in goal.get_fields_and_field_types().items(): if v not in ["unilabos_msgs/Resource", "sequence"]: continue diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index 71826ae1..b791552b 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -143,7 +143,19 @@ class HostNode(BaseROS2DeviceNode): controller_config["update_rate"] = update_rate self.initialize_controller(controller_id, controller_config) resources_config.insert(0, { - + "id": "host_node", + "name": "host_node", + "parent": None, + "type": "device", + "class": "host_node", + "position": { + "x": 0, + "y": 0, + "z": 0 + }, + "config": {}, + "data": {}, + "children": [] }) try: for bridge in self.bridges: