Skip to content

Commit ae3a6b9

Browse files
committed
Remove duplicated waitFor function
1 parent 762288b commit ae3a6b9

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

include/ur_client_library/primary/primary_client.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ class PrimaryClient
152152
*/
153153
bool reconnectStream();
154154

155-
bool waitFor(std::function<bool()> condition, const std::chrono::milliseconds timeout,
156-
const std::chrono::milliseconds check_interval = std::chrono::milliseconds(50));
157-
158155
// The function is called whenever an error code message is received
159156
void errorMessageCallback(ErrorCode& code);
160157

src/primary/primary_client.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,5 @@ bool PrimaryClient::commandBrakeRelease(const bool validate, const std::chrono::
200200
return true;
201201
}
202202

203-
bool PrimaryClient::waitFor(std::function<bool()> condition, const std::chrono::milliseconds timeout,
204-
const std::chrono::milliseconds check_interval)
205-
{
206-
auto start_time = std::chrono::system_clock::now();
207-
while (std::chrono::system_clock::now() - start_time < timeout)
208-
{
209-
if (condition())
210-
{
211-
return true;
212-
}
213-
URCL_LOG_DEBUG("Waiting for condition to be met...");
214-
std::this_thread::sleep_for(check_interval);
215-
}
216-
return false;
217-
}
218203
} // namespace primary_interface
219204
} // namespace urcl

0 commit comments

Comments
 (0)