CIMUDevice Class Reference

This class contains the the devices module and the thread for read the measurements. More...

#include <RobotAPI/drivers/XsensIMU/IMU/IMUDevice.h>

Public Types

enum  FusionStrategy { eNoFusion, eMeanFusion, eGaussianFusion }
 
enum  SamplingFrequency {
  eSamplingFrequency_10HZ = 0x2D00, eSamplingFrequency_12HZ = 0x2580, eSamplingFrequency_15HZ = 0x1E00, eSamplingFrequency_16HZ = 0x1C20,
  eSamplingFrequency_18HZ = 0x1900, eSamplingFrequency_20HZ = 0x1680, eSamplingFrequency_24HZ = 0x12C0, eSamplingFrequency_25HZ = 0x1200,
  eSamplingFrequency_30HZ = 0x0F00, eSamplingFrequency_32HZ = 0x0E10, eSamplingFrequency_36HZ = 0x0C80, eSamplingFrequency_40HZ = 0x0B40,
  eSamplingFrequency_45HZ = 0x0A00, eSamplingFrequency_48HZ = 0x0960, eSamplingFrequency_50HZ = 0x0900, eSamplingFrequency_60HZ = 0x0780,
  eSamplingFrequency_64HZ = 0x0708, eSamplingFrequency_72HZ = 0x0640, eSamplingFrequency_75HZ = 0x0600, eSamplingFrequency_80HZ = 0x05A0,
  eSamplingFrequency_90HZ = 0x0500, eSamplingFrequency_96HZ = 0x04B0, eSamplingFrequency_100HZ = 0x0480, eSamplingFrequency_120HZ = 0x03C0,
  eSamplingFrequency_128HZ = 0x0384, eSamplingFrequency_144HZ = 0x0320, eSamplingFrequency_150HZ = 0x0300, eSamplingFrequency_160HZ = 0x02D0,
  eSamplingFrequency_180HZ = 0x0280, eSamplingFrequency_192HZ = 0x0258, eSamplingFrequency_200HZ = 0x0240, eSamplingFrequency_225HZ = 0x0200,
  eSamplingFrequency_240HZ = 0x01E0, eSamplingFrequency_256HZ = 0x01C2, eSamplingFrequency_288HZ = 0x0190, eSamplingFrequency_300HZ = 0x0180,
  eSamplingFrequency_320HZ = 0x0168, eSamplingFrequency_360HZ = 0x0140, eSamplingFrequency_384HZ = 0x012C, eSamplingFrequency_400HZ = 0x0120,
  eSamplingFrequency_450HZ = 0x0100, eSamplingFrequency_480HZ = 0x00F0, eSamplingFrequency_512HZ = 0x00E1
}
 Enum specifying the supported sampling frequencies. More...
 
enum  ThreadPolicyType { eRealTime = SCHED_FIFO, eRoundRobinPriorityBased = SCHED_RR, eBatch = SCHED_BATCH, eIdle = SCHED_IDLE }
 Enum specifying the running thread policy. More...
 

Public Member Functions

 CIMUDevice ()
 The default constructor. The default constructor sets all member variables to zero, i.e. after construction no valid device nor thread are represented. More...
 
bool Connect (const std::string &PortName, const SamplingFrequency Frequency)
 
uint64_t GetDeviceId () const
 
IMUState GetIMUState () const
 
const timeval & GetReferenceTimeStamp () const
 
bool IsActive () const
 
bool RegisterEventDispatcher (IIMUEventDispatcher *pIMUEventDispatcher)
 
bool SetFusion (const FusionStrategy Strategy, const ushort SamplesPerFusion)
 
bool SetThreadRunnigMode (const ThreadPolicyType ThreadPolicy, const float NormalizedPriority)
 
bool Start (const bool Blocking=true)
 
void Stop (const bool Blocking=true)
 
bool UnregisterEventDispatcher (IIMUEventDispatcher *pIMUEventDispatcher)
 
virtual ~CIMUDevice ()
 The destructor. More...
 

Protected Member Functions

bool GaussianFuseCurrentState ()
 
void GaussianFusion ()
 
void IncorporateCurrentStateGaussianFusion ()
 
void IncorporateCurrentStateMeanFusion ()
 
bool IntegrateCurrentState ()
 
bool IntegrateWithFusion ()
 
bool IntegrateWithOutFusion ()
 
bool LoadCurrentState ()
 
bool MeanFuseCurrentState ()
 
void MeanFusion ()
 

Detailed Description

This class contains the the devices module and the thread for read the measurements.

CIMUDevice encapsulates the device details for the rest of the library and applications. This also includes a thread which is in charge of generate the IMU events

Definition at line 41 of file IMUDevice.h.

Member Enumeration Documentation

◆ FusionStrategy

Enumerator
eNoFusion 
eMeanFusion 
eGaussianFusion 

Definition at line 103 of file IMUDevice.h.

◆ SamplingFrequency

Enum specifying the supported sampling frequencies.

Enumerator
eSamplingFrequency_10HZ 
eSamplingFrequency_12HZ 
eSamplingFrequency_15HZ 
eSamplingFrequency_16HZ 
eSamplingFrequency_18HZ 
eSamplingFrequency_20HZ 
eSamplingFrequency_24HZ 
eSamplingFrequency_25HZ 
eSamplingFrequency_30HZ 
eSamplingFrequency_32HZ 
eSamplingFrequency_36HZ 
eSamplingFrequency_40HZ 
eSamplingFrequency_45HZ 
eSamplingFrequency_48HZ 
eSamplingFrequency_50HZ 
eSamplingFrequency_60HZ 
eSamplingFrequency_64HZ 
eSamplingFrequency_72HZ 
eSamplingFrequency_75HZ 
eSamplingFrequency_80HZ 
eSamplingFrequency_90HZ 
eSamplingFrequency_96HZ 
eSamplingFrequency_100HZ 
eSamplingFrequency_120HZ 
eSamplingFrequency_128HZ 
eSamplingFrequency_144HZ 
eSamplingFrequency_150HZ 
eSamplingFrequency_160HZ 
eSamplingFrequency_180HZ 
eSamplingFrequency_192HZ 
eSamplingFrequency_200HZ 
eSamplingFrequency_225HZ 
eSamplingFrequency_240HZ 
eSamplingFrequency_256HZ 
eSamplingFrequency_288HZ 
eSamplingFrequency_300HZ 
eSamplingFrequency_320HZ 
eSamplingFrequency_360HZ 
eSamplingFrequency_384HZ 
eSamplingFrequency_400HZ 
eSamplingFrequency_450HZ 
eSamplingFrequency_480HZ 
eSamplingFrequency_512HZ 

Definition at line 56 of file IMUDevice.h.

◆ ThreadPolicyType

Enum specifying the running thread policy.

Enumerator
eRealTime 
eRoundRobinPriorityBased 
eBatch 
eIdle 

Definition at line 48 of file IMUDevice.h.

Constructor & Destructor Documentation

◆ CIMUDevice()

The default constructor. The default constructor sets all member variables to zero, i.e. after construction no valid device nor thread are represented.

Definition at line 14 of file IMUDevice.cpp.

◆ ~CIMUDevice()

~CIMUDevice ( )
virtual

The destructor.

Definition at line 29 of file IMUDevice.cpp.

Member Function Documentation

◆ Connect()

bool Connect ( const std::string &  PortName,
const SamplingFrequency  Frequency 
)

Definition at line 39 of file IMUDevice.cpp.

◆ GaussianFuseCurrentState()

bool GaussianFuseCurrentState ( )
protected

Definition at line 366 of file IMUDevice.cpp.

+ Here is the call graph for this function:

◆ GaussianFusion()

void GaussianFusion ( )
protected

Definition at line 388 of file IMUDevice.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDeviceId()

uint64_t GetDeviceId ( ) const

Definition at line 34 of file IMUDevice.cpp.

+ Here is the caller graph for this function:

◆ GetIMUState()

IMUState GetIMUState ( ) const
inline

Definition at line 121 of file IMUDevice.h.

+ Here is the caller graph for this function:

◆ GetReferenceTimeStamp()

const timeval& GetReferenceTimeStamp ( ) const
inline

Definition at line 148 of file IMUDevice.h.

+ Here is the caller graph for this function:

◆ IncorporateCurrentStateGaussianFusion()

void IncorporateCurrentStateGaussianFusion ( )
protected

Definition at line 379 of file IMUDevice.cpp.

+ Here is the caller graph for this function:

◆ IncorporateCurrentStateMeanFusion()

void IncorporateCurrentStateMeanFusion ( )
protected

Definition at line 342 of file IMUDevice.cpp.

+ Here is the caller graph for this function:

◆ IntegrateCurrentState()

bool IntegrateCurrentState ( )
protected

Definition at line 404 of file IMUDevice.cpp.

+ Here is the call graph for this function:

◆ IntegrateWithFusion()

bool IntegrateWithFusion ( )
protected

Definition at line 421 of file IMUDevice.cpp.

+ Here is the caller graph for this function:

◆ IntegrateWithOutFusion()

bool IntegrateWithOutFusion ( )
protected

Definition at line 416 of file IMUDevice.cpp.

+ Here is the caller graph for this function:

◆ IsActive()

bool IsActive ( ) const

Definition at line 113 of file IMUDevice.cpp.

◆ LoadCurrentState()

bool LoadCurrentState ( )
protected

Definition at line 268 of file IMUDevice.cpp.

+ Here is the call graph for this function:

◆ MeanFuseCurrentState()

bool MeanFuseCurrentState ( )
protected

Definition at line 329 of file IMUDevice.cpp.

+ Here is the call graph for this function:

◆ MeanFusion()

void MeanFusion ( )
protected

Definition at line 350 of file IMUDevice.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterEventDispatcher()

bool RegisterEventDispatcher ( IIMUEventDispatcher pIMUEventDispatcher)

Definition at line 118 of file IMUDevice.cpp.

+ Here is the call graph for this function:

◆ SetFusion()

bool SetFusion ( const FusionStrategy  Strategy,
const ushort  SamplesPerFusion 
)

Definition at line 93 of file IMUDevice.cpp.

◆ SetThreadRunnigMode()

bool SetThreadRunnigMode ( const ThreadPolicyType  ThreadPolicy,
const float  NormalizedPriority 
)

Definition at line 563 of file IMUDevice.cpp.

◆ Start()

bool Start ( const bool  Blocking = true)

Definition at line 57 of file IMUDevice.cpp.

◆ Stop()

void Stop ( const bool  Blocking = true)

Definition at line 77 of file IMUDevice.cpp.

◆ UnregisterEventDispatcher()

bool UnregisterEventDispatcher ( IIMUEventDispatcher pIMUEventDispatcher)

Definition at line 139 of file IMUDevice.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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