Skip to content

Commit c51b605

Browse files
committed
Merge branch 'humble' of github.com:BehaviorTree/BehaviorTree.ROS2 into humble
2 parents cb4b1f6 + 60ffdd4 commit c51b605

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

behaviortree_ros2/include/behaviortree_ros2/bt_action_node.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ template<class T> inline
427427
template<class T> inline
428428
void RosActionNode<T>::cancelGoal()
429429
{
430+
auto future_result = action_client_->async_get_result(goal_handle_);
430431
auto future_cancel = action_client_->async_cancel_goal(goal_handle_);
431432

432433
if (callback_group_executor_.spin_until_future_complete(future_cancel, server_timeout_) !=
@@ -435,6 +436,13 @@ template<class T> inline
435436
RCLCPP_ERROR( node_->get_logger(), "Failed to cancel action server for [%s]",
436437
prev_action_name_.c_str());
437438
}
439+
440+
if (callback_group_executor_.spin_until_future_complete(future_result) !=
441+
rclcpp::FutureReturnCode::SUCCESS)
442+
{
443+
RCLCPP_ERROR( node_->get_logger(), "Failed to get result call failed :( for [%s]",
444+
prev_action_name_.c_str());
445+
}
438446
}
439447

440448

0 commit comments

Comments
 (0)