xsens_imu
Public Member Functions | List of all members
xsens::TimeSync Class Reference

Class for synchronizing two clocks. More...

#include <xsens_time.h>

Public Member Functions

 TimeSync (double skew, int historySize)
 Constructor. More...
 
 ~TimeSync ()
 Destructor. More...
 
int isInitialized () const
 Returns whether the TimeSync has passed the initial stage of initialization. More...
 
void reset ()
 Reset the time sync algorithm. More...
 
void update (TimeStamp local, TimeStamp external)
 Update the time synchronization with new information. More...
 
void setInitialSkew (double skew)
 Set the initial skew value. Since using this value requires a reset, the function automatically resets the TimeSync. More...
 
TimeStamp localTime (TimeStamp external)
 Returns the local time computed from the supplied reference time. More...
 
TimeStamp externalTime (TimeStamp local)
 Returns the reference time computed from the supplied local time. More...
 

Detailed Description

Class for synchronizing two clocks.

Constructor & Destructor Documentation

◆ TimeSync()

xsens::TimeSync::TimeSync ( double  skew,
int  historySize 
)

Constructor.

◆ ~TimeSync()

xsens::TimeSync::~TimeSync ( )

Destructor.

Member Function Documentation

◆ externalTime()

TimeStamp xsens::TimeSync::externalTime ( TimeStamp  local)

Returns the reference time computed from the supplied local time.

◆ isInitialized()

int xsens::TimeSync::isInitialized ( ) const

Returns whether the TimeSync has passed the initial stage of initialization.

◆ localTime()

TimeStamp xsens::TimeSync::localTime ( TimeStamp  external)

Returns the local time computed from the supplied reference time.

◆ reset()

void xsens::TimeSync::reset ( void  )

Reset the time sync algorithm.

◆ setInitialSkew()

void xsens::TimeSync::setInitialSkew ( double  skew)

Set the initial skew value. Since using this value requires a reset, the function automatically resets the TimeSync.

◆ update()

void xsens::TimeSync::update ( TimeStamp  local,
TimeStamp  external 
)

Update the time synchronization with new information.

The computations can be done in double precision, since doubles have a worst-case precision in the 'normal' range of 15 decimals, which fits about 32000 years while retaining ms precision.

Parameters
localThe local time. This time value may have noise on it caused by a delay.
externalThe external time. This time must be exactly as supplied by the time source.

The documentation for this class was generated from the following files: