From 125347ba58f22a56423de0f87b9168c61fed4a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20I=C3=B1igo=20Blasco?= Date: Sat, 1 Jun 2024 22:01:24 +0200 Subject: [PATCH] Bug/cancel action blocker (#542) * safe blocker bug on action cancellation * format fix --- .../include/smacc2/client_bases/smacc_action_client_base.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smacc2/include/smacc2/client_bases/smacc_action_client_base.hpp b/smacc2/include/smacc2/client_bases/smacc_action_client_base.hpp index ff3072a80..f93bbe0b0 100644 --- a/smacc2/include/smacc2/client_bases/smacc_action_client_base.hpp +++ b/smacc2/include/smacc2/client_bases/smacc_action_client_base.hpp @@ -100,6 +100,7 @@ class SmaccActionClientBase : public ISmaccActionClient std::optional> lastRequest_; // typename GoalHandle::SharedPtr goalHandle_; + std::optional> lastCancelResponse_; SmaccActionResultSignal onSucceeded_; SmaccActionResultSignal onAborted_; @@ -217,8 +218,7 @@ class SmaccActionClientBase : public ISmaccActionClient virtual bool cancelGoal() override { - auto fut = this->client_->async_cancel_all_goals(); - fut.wait(); + lastCancelResponse_ = this->client_->async_cancel_all_goals(); // if (lastRequest_ && lastRequest_->valid()) // {