From 183579fd7fc058a64654bb8ec1dca30fb10eff28 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Tue, 17 Jun 2025 15:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4device=E7=9A=84=E7=88=B6?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unilabos/ros/nodes/presets/host_node.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index d6d9d35..ceba584 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -195,18 +195,18 @@ class HostNode(BaseROS2DeviceNode): resource_ids_to_instance = {i["id"]: i for i in resources_config} resource_name_to_with_parent_name = {} for res in resources_config: - if res.get("parent") and res.get("type") == "device" and res.get("class"): - parent_id = res.get("parent") - parent_res = resource_ids_to_instance[parent_id] - if parent_res.get("type") == "device" and parent_res.get("class"): - resource_with_parent_name.append(copy.deepcopy(res)) - resource_name_to_with_parent_name[resource_with_parent_name[-1]["id"]] = f"{parent_res['id']}/{res['id']}" - resource_with_parent_name[-1]["id"] = f"{parent_res['id']}/{res['id']}" - continue + # if res.get("parent") and res.get("type") == "device" and res.get("class"): + # parent_id = res.get("parent") + # parent_res = resource_ids_to_instance[parent_id] + # if parent_res.get("type") == "device" and parent_res.get("class"): + # resource_with_parent_name.append(copy.deepcopy(res)) + # resource_name_to_with_parent_name[resource_with_parent_name[-1]["id"]] = f"{parent_res['id']}/{res['id']}" + # resource_with_parent_name[-1]["id"] = f"{parent_res['id']}/{res['id']}" + # continue resource_with_parent_name.append(copy.deepcopy(res)) - for edge in self.resources_edge_config: - edge["source"] = resource_name_to_with_parent_name.get(edge.get("source"), edge.get("source")) - edge["target"] = resource_name_to_with_parent_name.get(edge.get("target"), edge.get("target")) + # for edge in self.resources_edge_config: + # edge["source"] = resource_name_to_with_parent_name.get(edge.get("source"), edge.get("source")) + # edge["target"] = resource_name_to_with_parent_name.get(edge.get("target"), edge.get("target")) try: for bridge in self.bridges: if hasattr(bridge, "resource_add"):