fix protocol node log_message, added create_resource return value

This commit is contained in:
Xuwznln
2025-09-19 05:31:49 +08:00
parent 01f8816597
commit da4bd927e0
7 changed files with 43 additions and 17 deletions

View File

@@ -218,7 +218,7 @@ class ROS2ProtocolNode(BaseROS2DeviceNode):
[convert_from_ros_msg(rs) for rs in response.resources]
)
self.lab_logger().info(f"🔍 最终的 vessel: {protocol_kwargs.get('vessel', 'NOT_FOUND')}")
# self.lab_logger().info(f"🔍 最终的 vessel: {protocol_kwargs.get('vessel', 'NOT_FOUND')}")
from unilabos.resources.graphio import physical_setup_graph
@@ -325,6 +325,8 @@ class ROS2ProtocolNode(BaseROS2DeviceNode):
async def execute_single_action(self, device_id, action_name, action_kwargs):
"""执行单个动作"""
# 构建动作ID
if action_name == "log_message":
self.lab_logger().info(f"[Protocol Log] {action_kwargs}")
if device_id in ["", None, "self"]:
action_id = f"/devices/{self.device_id}/{action_name}"
else: