xsens_imu
Classes | Typedefs | Functions | Variables
xsens Namespace Reference

The namespace of all Xsens software since 2006. More...

Classes

class  Cmt1f
 The low-level file communication class. More...
 
class  Cmt1s
 The low-level serial communication class. More...
 
class  Cmt2f
 The mid-level file communication class. More...
 
class  Cmt2s
 Mid-level serial communication class. More...
 
class  Cmt3
 High-level communication class. More...
 
class  Exception
 
class  FifoQueue
 A FIFO queue with limited length (cyclic). More...
 
class  FifoQueueBasic
 A FIFO queue with limited length (cyclic). More...
 
union  Itypes
 
class  JanitorClassFunc
 Class function calling janitor class. More...
 
class  JanitorClassFuncP1
 Class function calling janitor class with a parameter. More...
 
class  List
 Dynamic list class. More...
 
class  Message
 Class for storing a single message. More...
 
struct  MessageHeader
 A message header. More...
 
class  MillisecondTimer
 
class  Packet
 A structure containing MT data + timestamp and formatting information. More...
 
class  TimeSync
 Class for synchronizing two clocks. More...
 
struct  TimeSyncHistoryUnit
 A single time of receive / time of send pair. More...
 
class  TimeSyncPrivate
 Private data for the TimeSync class. More...
 

Typedefs

typedef int32_t HANDLE
 
typedef int64_t TimeStamp
 A real-time timestamp (ms) More...
 

Functions

int _wcsnicmp (const wchar_t *s1, const wchar_t *s2, int count)
 
int32_t findValidMessage (const uint8_t *buffer, const uint16_t bufferLength)
 Find a valid message in the given buffer. If nothing is found, the function returns -1. Otherwise the index of the first character of the message is returned. More...
 
uint8_t computeChecksum (const uint8_t *buffer, uint32_t length)
 Compute the checksum of the given byte string. More...
 
bool cmtScanPort (CmtPortInfo &portInfo, uint32_t baudrate=0, uint32_t singleScanTimeout=1000, uint32_t scanTries=1)
 Scan a single COM port for connected Xsens devices. More...
 
bool cmtScanPorts (List< CmtPortInfo > &ports, uint32_t baudrate=0, uint32_t singleScanTimeout=1000, uint32_t scanTries=1, bool ignoreNonXsensDevices=true)
 Scan COM ports for connected Xsens devices. More...
 
uint32_t getTimeOfDay (tm *date_, time_t *secs_)
 A platform-independent clock. More...
 
int64_t getDateTime (tm *date=0)
 Retrieves the date and time (platform-independent) More...
 
void getDateAsString (uint8_t *dest, tm const *date=0)
 Retrieves the date as string representation The format is YYYYMMDD so 25 dec 2010 is stored as an array dest[8] = {'2', '0', '1', '0', '1', '2', '2', '5' }. More...
 
void getTimeAsString (uint8_t *dest, tm const *date=0)
 Retrieves the time as binary The format is HHMMSShh (where H is hour and 'h' is hundredths) so 14:25:01.23 is stored as an array dest[8] = { '1', '4', '2', '5', '0', '1', '2', '3'}. More...
 
void msleep (uint32_t ms)
 Sleep for ms milliseconds. More...
 
TimeStamp timeStampNow ()
 
void initializeTime ()
 Stabilize the clock. More...
 

Variables

bool abortScan = false
 Set to true from another thread to abort any scan currently in progress. More...
 

Detailed Description

The namespace of all Xsens software since 2006.

Typedef Documentation

typedef int32_t xsens::HANDLE
typedef int64_t xsens::TimeStamp

A real-time timestamp (ms)

Function Documentation

int xsens::_wcsnicmp ( const wchar_t *  s1,
const wchar_t *  s2,
int  count 
)
bool xsens::cmtScanPort ( CmtPortInfo portInfo,
uint32_t  baudrate = 0,
uint32_t  singleScanTimeout = 1000,
uint32_t  scanTries = 1 
)

Scan a single COM port for connected Xsens devices.

The cmtScanPort function will scan a single port for connected Xsens devices. If the baudrate parameter is 0 (default), it will try to connect at all supported baud rates, starting with the most common 115k2, 460k8 and 58k6. If the baudrate parameter is non-zero, only the specified baud rate is tried. Any detected devices are returned in the portInfo parameter.

bool xsens::cmtScanPorts ( List< CmtPortInfo > &  ports,
uint32_t  baudrate = 0,
uint32_t  singleScanTimeout = 1000,
uint32_t  scanTries = 1,
bool  ignoreNonXsensDevices = true 
)

Scan COM ports for connected Xsens devices.

The cmtScanPorts function will scan registered Xsens USB converters and serial COM ports for connected Xsens devices. If the baudrate parameter is 0 (default), it will try to connect at all supported baud rates, starting with the most common 115k2, 460k8 and 58k6. If the baudrate parameter is non-zero, only the specified baudrate is tried. Any detected devices are returned in the ports list, which is sorted by port nr.

uint8_t xsens::computeChecksum ( const uint8_t *  buffer,
uint32_t  length 
)

Compute the checksum of the given byte string.

int32_t xsens::findValidMessage ( const uint8_t *  buffer,
const uint16_t  bufferLength 
)

Find a valid message in the given buffer. If nothing is found, the function returns -1. Otherwise the index of the first character of the message is returned.

void xsens::getDateAsString ( uint8_t *  dest,
tm const *  date = 0 
)

Retrieves the date as string representation The format is YYYYMMDD so 25 dec 2010 is stored as an array dest[8] = {'2', '0', '1', '0', '1', '2', '2', '5' }.

Parameters
dest: A pointer to an array of at least (!) 8 bytes
date: If date is non-zero this date is converted, otherwise the current date is retrieved and used)
int64_t xsens::getDateTime ( tm *  date = 0)

Retrieves the date and time (platform-independent)

Parameters
date: if non-zero the local (!) date and time is stored in the tm struct this parameter points to
Returns
The UTC date and time as seconds since 1970
void xsens::getTimeAsString ( uint8_t *  dest,
tm const *  date = 0 
)

Retrieves the time as binary The format is HHMMSShh (where H is hour and 'h' is hundredths) so 14:25:01.23 is stored as an array dest[8] = { '1', '4', '2', '5', '0', '1', '2', '3'}.

Parameters
dest: A pointer to an array of at least (!) 8 bytes
date: If date is non-zero this date is converted, otherwise the current date is retrieved and used)
Note
(for now hundreths are set to 0)
uint32_t xsens::getTimeOfDay ( tm *  date_ = NULL,
time_t *  secs_ = NULL 
)

A platform-independent clock.

The function returns the time of day in ms since midnight. If the date parameter is non-NULL, corresponding the date is placed in the variable it points to.

void xsens::initializeTime ( )

Stabilize the clock.

Repeatedly call timeStampNow for 16-32 ms to stabilize the clock

void xsens::msleep ( uint32_t  ms)

Sleep for ms milliseconds.

A platform-independent sleep routine.

A platform independent sleep routine to sleep for at least ms milliseconds.

On linux we are using pthread_cond_t, which implies that the timedwait() is a cancellation point. This function might return sooner than expected in some cases.

Time is measured in ms. The function will not return until the specified number of ms have passed.

TimeStamp xsens::timeStampNow ( )

Variable Documentation

bool xsens::abortScan = false

Set to true from another thread to abort any scan currently in progress.