Skip to content

Commit

Permalink
Fixes TimeSync with robot (#544)
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Schweiger <[email protected]>
  • Loading branch information
mschweig authored Jan 7, 2025
1 parent bf06fdc commit aae0b4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spot_driver/src/api/default_time_sync_api.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2023-2024 Boston Dynamics AI Institute LLC. All rights reserved.

#include <chrono>
#include <spot_driver/api/default_time_sync_api.hpp>
#include <tl_expected/expected.hpp>

Expand All @@ -12,6 +13,9 @@ tl::expected<google::protobuf::Duration, std::string> DefaultTimeSyncApi::getClo
if (!time_sync_thread_) {
return tl::make_unexpected("Time sync thread was not initialized.");
}
if (!time_sync_thread_->WaitForSync(std::chrono::seconds(5))) {
return tl::make_unexpected("Failed to establish time sync before timing out.");
}
if (!time_sync_thread_->HasEstablishedTimeSync()) {
return tl::make_unexpected("Time sync not yet established between Spot and the local system.");
}
Expand Down

0 comments on commit aae0b4b

Please sign in to comment.