Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
backport #ros2#656
Browse files Browse the repository at this point in the history
  • Loading branch information
reed-lau committed Aug 16, 2019
1 parent 1869b84 commit 1af7a70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rclcpp/src/rclcpp/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ ClientBase::wait_for_service_nanoseconds(std::chrono::nanoseconds timeout)
if (!node_ptr) {
throw InvalidNodeError();
}
auto event = node_ptr->get_graph_event();
// check to see if the server is ready immediately
if (this->service_is_ready()) {
return true;
Expand All @@ -118,6 +117,7 @@ ClientBase::wait_for_service_nanoseconds(std::chrono::nanoseconds timeout)
// check was non-blocking, return immediately
return false;
}
auto event = node_ptr->get_graph_event();
// update the time even on the first loop to account for time spent in the first call
// to this->server_is_ready()
std::chrono::nanoseconds time_to_wait = timeout - (std::chrono::steady_clock::now() - start);
Expand Down

0 comments on commit 1af7a70

Please sign in to comment.