Skip to content

Commit 9ec8be3

Browse files
authored
Merge pull request #8 from nobleo/fix/HARVEY2-344-abort-not-implemented
Fix SimpleActionState aborted flow
2 parents 32d9f1c + daa00ac commit 9ec8be3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

smach_ros/smach_ros/simple_action_state.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class ActionState(Enum):
5858
CANCELING = 3
5959
CANCELED = 4
6060
COMPLETED = 5
61+
ABORTED = 6
6162

6263

6364
class SimpleActionState(RosState):
@@ -453,7 +454,7 @@ def execute(self, ud):
453454
if self.preempt_requested():
454455
self.service_preempt()
455456
outcome = 'preempted'
456-
elif self._status == ActionState.CANCELING:
457+
elif self._status == ActionState.CANCELING or self._status == ActionState.ABORTED:
457458
# Preempting or exec timeout but goal not cancelled
458459
outcome = 'aborted'
459460
else:
@@ -531,7 +532,7 @@ def get_result_str(i):
531532
elif self._goal_status == GoalStatus.STATUS_CANCELED:
532533
self._status = ActionState.CANCELED
533534
elif self._goal_status == GoalStatus.STATUS_ABORTED:
534-
self._status = ActionState.CANCELED
535+
self._status = ActionState.ABORTED
535536

536537
self.node.get_logger().debug(f"Goal completed: {self._client_goal_handle}")
537538

0 commit comments

Comments
 (0)