From a312de08a511f95bd5f4731fa77a215a08bfeb53 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Sat, 30 Aug 2025 12:20:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20station=E8=87=AA=E5=B7=B1=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=B3=A8=E5=86=8C=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unilabos/ros/nodes/presets/workstation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unilabos/ros/nodes/presets/workstation.py b/unilabos/ros/nodes/presets/workstation.py index c790940d..de4e94cf 100644 --- a/unilabos/ros/nodes/presets/workstation.py +++ b/unilabos/ros/nodes/presets/workstation.py @@ -289,6 +289,9 @@ class ROS2WorkstationNode(BaseROS2DeviceNode): def create_ros_action_server(self, action_name, action_value_mapping): """创建ROS动作服务器""" + if action_name not in self.protocol_names: + # 非protocol方法调用父类注册 + return super().create_ros_action_server(action_name, action_value_mapping) # 和Base创建的路径是一致的 protocol_name = action_name action_type = action_value_mapping["type"] @@ -303,8 +306,8 @@ class ROS2WorkstationNode(BaseROS2DeviceNode): execute_callback=self._create_protocol_execute_callback(action_name, protocol_steps_generator), callback_group=ReentrantCallbackGroup(), ) - self.lab_logger().trace(f"发布动作: {action_name}, 类型: {str_action_type}") + return def _create_protocol_execute_callback(self, protocol_name, protocol_steps_generator): async def execute_protocol(goal_handle: ServerGoalHandle):