Skip to content

Commit

Permalink
get future once
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Najjar <[email protected]>
  • Loading branch information
tonynajjar committed Aug 7, 2024
1 parent 640b0eb commit 8eccb33
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ inline BT::NodeStatus RemoveInCollisionGoals::tick()
auto future = get_cost_client_->async_send_request(request);
auto ret = rclcpp::spin_until_future_complete(node_, future, server_timeout_);
if (ret == rclcpp::FutureReturnCode::SUCCESS) {
for (size_t i = 0; i < future.get()->costs.size(); ++i) {
if (future.get()->costs[i] <= cost_threshold_) {
auto response = future.get();
for (size_t i = 0; i < response->costs.size(); ++i) {
if (response->costs[i] <= cost_threshold_) {
valid_goal_poses.push_back(goal_poses[i]);
}
}
Expand Down

0 comments on commit 8eccb33

Please sign in to comment.