In ROS 2 Humble, when you send out a goal with "async_send_goal", assign the returned future goal handle to a variable. When you need to query for the result, you can just call "async_get_result" or "async_result" (deprecated). For example:
auto future_goal_handle = client_ptr_->async_send_goal(goal_msg, send_goal_options);
rclcpp::spin_until_future_complete(node, future_goal_handle);
auto result = client_ptr_-> async_get_result(future_goal_handle.get());
if (result.get().code == rclcpp_action::ResultCode::SUCCEEDED)
{
return true;
}
Note that the "result" you get is a WrappedResult, so if you want the result message, you need to do something like:
result.get().result
You can also query for goal status through the client goal handle with "get_status" if you are comparing with action_client->get_state()
instead.