ark::time::TimeModel
Defined in header “ark/time/time_model.hh”.
Represents a class that allows you to convert a timestamp in one frame to a timestamp in another frame.
Normally produced from a time estimator.
Methods
-
TimeModel(typename LocalClock::time_point measurement_time, std::chrono::nanoseconds offset, std::chrono::nanoseconds drift)
Constructor. Initializes the time model with the offset from a local clock to a remote clock, and the estimated rate that they are drifting at. -
TimeModel(const TimeModelMessage & msg)
Constructor. Initializes the time model from the given message. -
RemoteClock::time_point local_to_remote(const typename LocalClock::time_point & local_time)
Transforms the time in your local clock’s frame to the remote clock’s frame. -
LocalClock::time_point remote_to_local(const typename RemoteClock::time_point & global_time)
Transforms the time in your remote clock’s frame into your local clock’s frame. Note that there is some precision loss with this transform, and it may only be accurate to the millisecond level. -
TimeModelMessage get_message()
Transform the Model into message format. -
void set_from_message(const TimeModelMessage & msg)
Set the values from a TimeModelMessage.