Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,21 @@ class BtActionNode : public BT::ActionNodeBase
auto send_goal_options = typename rclcpp_action::Client<ActionT>::SendGoalOptions();
send_goal_options.result_callback =
[this](const typename rclcpp_action::ClientGoalHandle<ActionT>::WrappedResult & result) {
if (!this->goal_handle_) {
if (!future_goal_handle_) {
// Shouldn't run into this block scope
RCLCPP_WARN(
node_->get_logger(),
"Goal result for %s available, but it can not get a valid goal_handle_. "
"Normally, this message shouldn't be printed.",
action_name_.c_str());
return;
}

// If the future_goal_handle_ is not nullptr, try to get goal_handle_
this->goal_handle_ = future_goal_handle_->get();
}

// TODO(#1652): a work around until rcl_action interface is updated
// if goal ids are not matched, the older goal call this callback so ignore the result
// if matched, it must be processed (including aborted)
Expand Down