VectorNav C++ Library
attitude.h
1 #ifndef _VNMATH_ATTITUDE_H_
2 #define _VNMATH_ATTITUDE_H_
3 
4 #include "vector.h"
5 #include "matrix.h"
6 #include "export.h"
7 
8 namespace vn {
9 namespace math {
10 
12 class vn_proglib_DLLEXPORT AttitudeF
13 {
14 private:
15 
16  enum AttitudeType
17  {
18  ATT_YprRads,
19  ATT_YprDegs,
20  ATT_Quat,
21  ATT_Dcm
22  };
23 
24 public:
25 
27  static AttitudeF noRotation();
28 
33  static AttitudeF fromQuat(vec4f quat);
34 
39  static AttitudeF fromYprInDegs(vec3f yprInDegs);
40 
45  static AttitudeF fromYprInRads(vec3f yprInRads);
46 
51  static AttitudeF fromDcm(mat3f dcm);
52 
53  // TEMP
54  AttitudeF() { }
55 
56 private:
57 
58  AttitudeF(AttitudeType type, void* attitude);
59 
60 public:
61 
64  vec3f yprInDegs();
65 
68  vec3f yprInRads();
69 
72  vec4f quat();
73 
76  mat3f dcm();
77 
78 private:
79  AttitudeType _underlyingType;
80  uint8_t _data[sizeof(mat3f)];
81 };
82 
83 }
84 }
85 
86 #endif
Template for a Euclidean vector.
Definition: vector.h:22
Template for a matrix.
Definition: matrix.h:20
Definition: attitude.h:8
Representation of an orientation/attitude.
Definition: attitude.h:12