From daa00ac9ad11476064910f612b34bb6fec1fbe6d Mon Sep 17 00:00:00 2001 From: Ferry Schoenmakers Date: Thu, 10 Oct 2024 11:58:05 +0200 Subject: [PATCH] Fix SimpleActionState aborted flow --- smach_ros/smach_ros/simple_action_state.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smach_ros/smach_ros/simple_action_state.py b/smach_ros/smach_ros/simple_action_state.py index 1931aed..812590b 100644 --- a/smach_ros/smach_ros/simple_action_state.py +++ b/smach_ros/smach_ros/simple_action_state.py @@ -58,6 +58,7 @@ class ActionState(Enum): CANCELING = 3 CANCELED = 4 COMPLETED = 5 + ABORTED = 6 class SimpleActionState(RosState): @@ -453,7 +454,7 @@ def execute(self, ud): if self.preempt_requested(): self.service_preempt() outcome = 'preempted' - elif self._status == ActionState.CANCELING: + elif self._status == ActionState.CANCELING or self._status == ActionState.ABORTED: # Preempting or exec timeout but goal not cancelled outcome = 'aborted' else: @@ -531,7 +532,7 @@ def get_result_str(i): elif self._goal_status == GoalStatus.STATUS_CANCELED: self._status = ActionState.CANCELED elif self._goal_status == GoalStatus.STATUS_ABORTED: - self._status = ActionState.CANCELED + self._status = ActionState.ABORTED self.node.get_logger().debug(f"Goal completed: {self._client_goal_handle}")