增加环绕侦察场景适配

This commit is contained in:
2026-01-08 15:44:38 +08:00
parent 3eba1f962b
commit 10c5bb5a8a
5441 changed files with 40219 additions and 379695 deletions

View File

@@ -485,6 +485,11 @@ def _add_nodes_and_edges(node: dict, dot, parent_id: str | None = None) -> str:
# 递归处理子节点 (Sequence, Selector, Parallel 等)
children = node.get("children", [])
# 兼容 decorator 类型的 child 字段 (处理为单元素列表以便统一逻辑)
if node_type == 'decorator' and 'child' in node:
children = [node['child']]
if children:
# 记录所有子节点的ID
child_ids = []
@@ -501,10 +506,10 @@ def _add_nodes_and_edges(node: dict, dot, parent_id: str | None = None) -> str:
for cid in child_ids:
s.node(cid)
# 递归处理单子节点 (Decorator)
child = node.get("child")
if child:
_add_nodes_and_edges(child, dot, current_id)
# 递归处理单子节点 (Decorator) - 已合并到 children 处理逻辑中,此处删除旧逻辑
# child = node.get("child")
# if child:
# _add_nodes_and_edges(child, dot, current_id)
return current_id