Flair
Framework Libre Air
AhrsData.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
12 #ifndef AHRSDATA_H
13 #define AHRSDATA_H
14 
15 #include <io_data.h>
16 #include <IODataElement.h>
17 #include <Vector3D.h>
18 #include <Quaternion.h>
19 
20 namespace flair {
21 namespace core {
22 
30 class AhrsData : public io_data {
31 public:
32  class Type : public DataType {
33  public:
34  Type(const ScalarType &inElementDataType)
35  : elementDataType(inElementDataType) {}
36  const ScalarType &GetElementDataType() const { return elementDataType; }
37  std::string GetDescription() const { return "ahrs data"; }
38  size_t GetSize() const { return 7 * elementDataType.GetSize(); }
39 
40  private:
41  const ScalarType &elementDataType;
42  };
43 
48  typedef enum {
49  Roll ,
51  Yaw ,
55  Q0 ,
56  Q1 ,
57  Q2 ,
58  Q3 ,
59  Wx ,
60  Wy ,
61  Wz ,
66 
76  AhrsData(const Object *parent, std::string name = "", int n = 1);
77 
82  ~AhrsData();
83 
93  IODataElement *Element(PlotableData_t plotableData) const;
94 
103  void SetQuaternion(const Quaternion &quaternion);
104 
113  Quaternion GetQuaternion(void) const;
114 
123  void SetAngularRates(const Vector3Df &angularRates);
124 
133  Vector3Df GetAngularRates(void) const;
134 
144  void GetQuaternionAndAngularRates(Quaternion &quaternion,
145  Vector3Df &angularRates) const;
146 
156  void SetQuaternionAndAngularRates(const Quaternion &quaternion,
157  const Vector3Df &angularRates);
158 
159  const Type &GetDataType() const { return dataType; }
160 
161 private:
170  void RawRead(char *dst) const;
171 
172  void Queue(char **dst, const void *src, size_t size) const;
173 
178  Quaternion quaternion;
179 
184  Vector3Df angularRates;
185 
186  Type dataType;
187 };
188 
189 } // end namespace core
190 } // end namespace flair
191 
192 #endif // AHRSDATA_H
Abstract class for data types.
Definition: io_data.h:94
Quaternion GetQuaternion(void) const
Get quaternion.
Definition: io_data.h:26
Base class for all Framework's classes.
Definition: Object.h:83
namespace of the flair Framework
Definition: Ahrs.h:19
Definition: AhrsData.h:50
Definition: AhrsData.h:58
void SetQuaternion(const Quaternion &quaternion)
Set quaternion.
Vector3Df GetAngularRates(void) const
Get angular rates.
Class defining AHRS datas.
Definition: AhrsData.h:30
Abstract class for data types.
void GetQuaternionAndAngularRates(Quaternion &quaternion, Vector3Df &angularRates) const
Get both quaternion and angular rates.
Class defining a 3D vector.
AhrsData(const Object *parent, std::string name="", int n=1)
Constructor.
Definition: AhrsData.h:55
Definition: AhrsData.h:32
Definition: AhrsData.h:57
Definition: AhrsData.h:52
Abstract class for accessing an element of an io_data.
Definition: io_data.h:40
Definition: AhrsData.h:59
Class defining a quaternion.
Definition: AhrsData.h:63
Definition: AhrsData.h:60
Definition: AhrsData.h:62
void SetQuaternionAndAngularRates(const Quaternion &quaternion, const Vector3Df &angularRates)
Set both quaternion and angular rates.
~AhrsData()
Destructor.
Definition: AhrsData.h:49
Abstract class for accessing an element of an io_data.
Definition: IODataElement.h:27
Definition: AhrsData.h:56
void SetAngularRates(const Vector3Df &angularRates)
Set angular rates.
IODataElement * Element(PlotableData_t plotableData) const
Element.
Definition: AhrsData.h:61
Definition: AhrsData.h:51
Definition: AhrsData.h:53
PlotableData_t
Datas wich can be plotted in a DataPlot1D.
Definition: AhrsData.h:48
Class defining a quaternion.
Definition: Quaternion.h:26
Definition: AhrsData.h:54
Definition: AhrsData.h:64