Skip to content

Commit

Permalink
Merge pull request #8 from nobleo/fix/HARVEY2-344-abort-not-implemented
Browse files Browse the repository at this point in the history
Fix SimpleActionState aborted flow
  • Loading branch information
MCFurry authored Oct 10, 2024
2 parents 32d9f1c + daa00ac commit 9ec8be3
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 9ec8be3

Please sign in to comment.