mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
fix: station自己的方法注册错误
This commit is contained in:
@@ -289,6 +289,9 @@ class ROS2WorkstationNode(BaseROS2DeviceNode):
|
|||||||
|
|
||||||
def create_ros_action_server(self, action_name, action_value_mapping):
|
def create_ros_action_server(self, action_name, action_value_mapping):
|
||||||
"""创建ROS动作服务器"""
|
"""创建ROS动作服务器"""
|
||||||
|
if action_name not in self.protocol_names:
|
||||||
|
# 非protocol方法调用父类注册
|
||||||
|
return super().create_ros_action_server(action_name, action_value_mapping)
|
||||||
# 和Base创建的路径是一致的
|
# 和Base创建的路径是一致的
|
||||||
protocol_name = action_name
|
protocol_name = action_name
|
||||||
action_type = action_value_mapping["type"]
|
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),
|
execute_callback=self._create_protocol_execute_callback(action_name, protocol_steps_generator),
|
||||||
callback_group=ReentrantCallbackGroup(),
|
callback_group=ReentrantCallbackGroup(),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.lab_logger().trace(f"发布动作: {action_name}, 类型: {str_action_type}")
|
self.lab_logger().trace(f"发布动作: {action_name}, 类型: {str_action_type}")
|
||||||
|
return
|
||||||
|
|
||||||
def _create_protocol_execute_callback(self, protocol_name, protocol_steps_generator):
|
def _create_protocol_execute_callback(self, protocol_name, protocol_steps_generator):
|
||||||
async def execute_protocol(goal_handle: ServerGoalHandle):
|
async def execute_protocol(goal_handle: ServerGoalHandle):
|
||||||
|
|||||||
Reference in New Issue
Block a user