fix protocol node

This commit is contained in:
Xuwznln
2025-08-12 17:08:59 +08:00
parent f791c1a342
commit e8c1f76dbb
3 changed files with 24 additions and 5 deletions

View File

@@ -223,9 +223,14 @@ class ROS2ProtocolNode(BaseROS2DeviceNode):
self.lab_logger().info(f"Working on physical setup: {physical_setup_graph}")
protocol_steps = protocol_steps_generator(G=physical_setup_graph, **protocol_kwargs)
logs = []
for step in protocol_steps:
if isinstance(step, dict) and "log_message" in step.get("action_kwargs", {}):
logs.append(step)
elif isinstance(step, list):
logs.append(step)
self.lab_logger().info(f"Goal received: {protocol_kwargs}, running steps: "
f"{json.dumps([step for step in protocol_steps if 'log_message' not in step['action_kwargs']], indent=4)}")
f"{json.dumps(logs, indent=4, ensure_ascii=False)}")
time_start = time.time()
time_overall = 100