Skip to content

Commit

Permalink
Send a cancellation message when action is canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass committed Dec 13, 2023
1 parent cc7bd99 commit 7c13032
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ def cancel_callback(self, cancel_request: ServerGoalHandle) -> CancelResponse:
if cancel_request.goal_id == goal_handle.goal_id:
self.protocol.log("warning", f"Canceling action {goal_id}")
self.goal_futures[goal_id].cancel()
cancel_message = {
"op": "cancel_action_goal",
"id": goal_id,
"action": self.action_name,
}
self.protocol.send(cancel_message)
return CancelResponse.ACCEPT

def handle_feedback(self, goal_id: str, feedback: Any) -> None:
Expand Down

0 comments on commit 7c13032

Please sign in to comment.