Flair
Framework Libre Air
flair::sensor::Imu Class Reference

Base class for Imu. More...

#include <Imu.h>

+ Inheritance diagram for flair::sensor::Imu:

Public Member Functions

 Imu (std::string name, bool needRotation=true)
 Constructor. More...
 
 Imu (const core::IODevice *parent, std::string name)
 Constructor. More...
 
 ~Imu ()
 Destructor. More...
 
const core::ImuDataGetDatas (void) const
 Get IMU datas. More...
 
gui::LayoutGetLayout (void) const
 Setup Layout. More...
 
void LockUserInterface (void) const
 Lock user interface. More...
 
void UnlockUserInterface (void) const
 Unlock user interface. More...
 
void UseDefaultPlot (void)
 Use default plot. More...
 
gui::TabGetPlotTab (void) const
 Plot tab. More...
 
core::OneAxisRotationGetOneAxisRotation (void) const
 Get OneAxisRotation. More...
 
- Public Member Functions inherited from flair::core::IODevice
 IODevice (const Object *parent, std::string name)
 Constructor. More...
 
virtual ~IODevice ()
 Destructor. More...
 
void AddDeviceToLog (const IODevice *device)
 Add an IODevice to the logs. More...
 
void AddDataToLog (const io_data *data)
 Add an io_data to the log. More...
 
void OutputToShMem (bool enabled)
 Send the output to a shared memory. More...
 
bool IsReady (void) const
 is device ready More...
 
virtual DataType const & GetInputDataType () const
 
virtual DataType const & GetOutputDataType () const
 
- Public Member Functions inherited from flair::core::Object
 Object (const Object *parent=NULL, std::string name="", std::string type="")
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string ObjectName (void) const
 Name. More...
 
std::string ObjectType (void) const
 Type. More...
 
const ObjectParent (void) const
 Parent. More...
 
std::vector< const Object * > * TypeChilds (void) const
 Childs of the same type. More...
 
std::vector< const Object * > * Childs (void) const
 Childs. More...
 
void Information (const char *function, int line, const char *format,...) const
 Formatted information. More...
 
void Warning (const char *function, const char *format,...) const
 Formatted warning. More...
 
void Error (const char *function, const char *format,...) const
 Formatted error. More...
 
bool ErrorOccured (bool recursive=true) const
 Has an errror occured? More...
 

Protected Member Functions

gui::GroupBoxGetGroupBox (void) const
 Setup GroupBox. More...
 
void ApplyRotation (core::Vector3Df &vector)
 ApplyRotation. More...
 
void ApplyRotation (core::Quaternion &quaternion)
 ApplyRotation. More...
 
void GetDatas (core::ImuData **imuData) const
 Get imu datas. More...
 
- Protected Member Functions inherited from flair::core::IODevice
void ProcessUpdate (io_data *data)
 Process the childs of type IODevice, and log if needed. More...
 
void SetIsReady (bool status)
 set is ready More...
 
virtual void UpdateFrom (const io_data *data)=0
 Update using provided datas. More...
 

Additional Inherited Members

- Public Types inherited from flair::core::Object
enum  color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 }
 

Detailed Description

Base class for Imu.

Use this class to define a custom Imu.

Constructor & Destructor Documentation

flair::sensor::Imu::Imu ( std::string  name,
bool  needRotation = true 
)

Constructor.

Construct an Imu. It will be child of the FrameworkManager.

Parameters
namename
needRotationtrue will enable post rotation in GCS. Post rotation must be applied manually in reimplemented code
flair::sensor::Imu::Imu ( const core::IODevice parent,
std::string  name 
)

Constructor.

Construct an Imu.
This contructor must only be called for a simulated device.

Parameters
parentparent
namename
flair::sensor::Imu::~Imu ( )

Destructor.

Member Function Documentation

const core::ImuData* flair::sensor::Imu::GetDatas ( void  ) const

Get IMU datas.

Returns
ImuData
gui::Layout* flair::sensor::Imu::GetLayout ( void  ) const

Setup Layout.

Returns
setup Layout
void flair::sensor::Imu::LockUserInterface ( void  ) const

Lock user interface.

void flair::sensor::Imu::UnlockUserInterface ( void  ) const

Unlock user interface.

void flair::sensor::Imu::UseDefaultPlot ( void  )

Use default plot.

gui::Tab* flair::sensor::Imu::GetPlotTab ( void  ) const

Plot tab.

Returns
plot Tab
core::OneAxisRotation* flair::sensor::Imu::GetOneAxisRotation ( void  ) const

Get OneAxisRotation.

Returns
fixed rotation of the imu
gui::GroupBox* flair::sensor::Imu::GetGroupBox ( void  ) const
protected

Setup GroupBox.

Returns
setup GroupBox
void flair::sensor::Imu::ApplyRotation ( core::Vector3Df vector)
protected

ApplyRotation.

The reimplemented class must call this function to rotate IMU datas, before filling the ImuData.
It handles the data rotation if it was defined.

Parameters
vectorvector to apply rotation to
void flair::sensor::Imu::ApplyRotation ( core::Quaternion quaternion)
protected

ApplyRotation.

The reimplemented class must call this function to rotate IMU datas, before filling the ImuData.
It handles the data rotation if it was defined.

Parameters
quaternionquaternion to apply rotation to
void flair::sensor::Imu::GetDatas ( core::ImuData **  imuData) const
protected

Get imu datas.

Can be used by dervied class to fill core::ImuData

Parameters
imuDataimu datas