Skip to content

Commit

Permalink
Fix SimpleActionState aborted flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferry Schoenmakers committed Oct 10, 2024
1 parent 32d9f1c commit daa00ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions smach_ros/smach_ros/simple_action_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class ActionState(Enum):
CANCELING = 3
CANCELED = 4
COMPLETED = 5
ABORTED = 6


class SimpleActionState(RosState):
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}")

Expand Down

0 comments on commit daa00ac

Please sign in to comment.