Skip to content

Commit

Permalink
Merge pull request #6043 from doronhi/handle_device_ts_delay
Browse files Browse the repository at this point in the history
 Handle get_device_time delay
  • Loading branch information
dorodnic committed Mar 25, 2020
2 parents 1b20fb4 + b0ee3f7 commit c8dc5a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/global_timestamp_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ namespace librealsense

double sample_hw_time = _device->get_device_time_ms();
double system_time_finish = duration<double, std::milli>(system_clock::now().time_since_epoch()).count();
if (system_time_finish - system_time_start > 2.0)
throw io_exception("get_device_time_ms() took too long (more then 2 mSecs)");
double system_time((system_time_finish + system_time_start) / 2);
if (sample_hw_time < _last_sample_hw_time)
{
Expand All @@ -179,6 +181,10 @@ namespace librealsense
_is_ready = true;
return true;
}
catch (const io_exception& ex)
{
LOG_DEBUG("Temporary skip during time_diff_keeper polling: " << ex.what());
}
catch (const wrong_api_call_sequence_exception& ex)
{
LOG_DEBUG("Temporary skip during time_diff_keeper polling: " << ex.what());
Expand Down

0 comments on commit c8dc5a9

Please sign in to comment.