[2] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file Euler.h
|
---|
| 7 | * \brief Class defining euler angles
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2013/05/02
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef EULER_H
|
---|
| 14 | #define EULER_H
|
---|
| 15 |
|
---|
[13] | 16 | namespace flair {
|
---|
| 17 | namespace core {
|
---|
| 18 | class Quaternion;
|
---|
[2] | 19 |
|
---|
[13] | 20 | /*! \class Euler
|
---|
| 21 | *
|
---|
| 22 | * \brief Class defining euler angles
|
---|
| 23 | *
|
---|
| 24 | * Euler angles are expressed in radians.
|
---|
| 25 | *
|
---|
| 26 | */
|
---|
| 27 | class Euler {
|
---|
| 28 | public:
|
---|
| 29 | /*!
|
---|
| 30 | * \brief Constructor
|
---|
| 31 | *
|
---|
| 32 | * Construct euler angles using specified values.
|
---|
| 33 | *
|
---|
| 34 | * \param roll roll value
|
---|
| 35 | * \param pitch pitch value
|
---|
| 36 | * \param yaw yaw value
|
---|
| 37 | */
|
---|
| 38 | Euler(float roll = 0, float pitch = 0, float yaw = 0);
|
---|
[2] | 39 |
|
---|
[13] | 40 | /*!
|
---|
| 41 | * \brief Destructor
|
---|
| 42 | *
|
---|
| 43 | */
|
---|
| 44 | ~Euler();
|
---|
[2] | 45 |
|
---|
[13] | 46 | /*!
|
---|
| 47 | * \brief x axis rotation
|
---|
| 48 | *
|
---|
| 49 | * \param value rotation value in radians
|
---|
| 50 | */
|
---|
| 51 | // todo: passer par un quaternion
|
---|
| 52 | // void RotateX(float value);
|
---|
[2] | 53 |
|
---|
[13] | 54 | /*!
|
---|
| 55 | * \brief x axis rotation
|
---|
| 56 | *
|
---|
| 57 | * \param value rotation value in degrees
|
---|
| 58 | */
|
---|
| 59 | // void RotateXDeg(float value);
|
---|
[2] | 60 |
|
---|
[13] | 61 | /*!
|
---|
| 62 | * \brief y axis rotation
|
---|
| 63 | *
|
---|
| 64 | * \param value rotation value in radians
|
---|
| 65 | */
|
---|
| 66 | // void RotateY(float value);
|
---|
[2] | 67 |
|
---|
[13] | 68 | /*!
|
---|
| 69 | * \brief y axis rotation
|
---|
| 70 | *
|
---|
| 71 | * \param value rotation value in degrees
|
---|
| 72 | */
|
---|
| 73 | // void RotateYDeg(float value);
|
---|
[2] | 74 |
|
---|
[13] | 75 | /*!
|
---|
| 76 | * \brief z axis rotation
|
---|
| 77 | *
|
---|
| 78 | * \param value rotation value in radians
|
---|
| 79 | */
|
---|
| 80 | // void RotateZ(float value);
|
---|
[2] | 81 |
|
---|
[13] | 82 | /*!
|
---|
| 83 | * \brief z axis rotation
|
---|
| 84 | *
|
---|
| 85 | * \param value rotation value in degrees
|
---|
| 86 | */
|
---|
| 87 | // void RotateZDeg(float value);
|
---|
[2] | 88 |
|
---|
[13] | 89 | /*!
|
---|
| 90 | * \brief Convert to quaternion
|
---|
| 91 | *
|
---|
| 92 | * \param quaternion output quaternion
|
---|
| 93 | */
|
---|
| 94 | void ToQuaternion(Quaternion &quaternion) const;
|
---|
[2] | 95 |
|
---|
[13] | 96 | /*!
|
---|
| 97 | * \brief Convert to quaternion
|
---|
| 98 | *
|
---|
| 99 | * \return quaternion
|
---|
| 100 | */
|
---|
| 101 | Quaternion ToQuaternion(void) const;
|
---|
| 102 | /*!
|
---|
| 103 | * \brief Convert from radian to degree
|
---|
| 104 | *
|
---|
| 105 | * \param radianValue value in radian
|
---|
| 106 | *
|
---|
| 107 | * \return value in degree
|
---|
| 108 | */
|
---|
| 109 | static float ToDegree(float radianValue);
|
---|
[2] | 110 |
|
---|
[13] | 111 | /*!
|
---|
| 112 | * \brief Convert from degree to radian
|
---|
| 113 | *
|
---|
| 114 | * \param degreeValue value in degree
|
---|
| 115 | *
|
---|
| 116 | * \return value in radian
|
---|
| 117 | */
|
---|
| 118 | static float ToRadian(float degreeValue);
|
---|
[2] | 119 |
|
---|
[13] | 120 | /*!
|
---|
| 121 | * \brief Compute yaw distance
|
---|
| 122 | *
|
---|
| 123 | * Compute yaw distance from given angle. This is the minimum distance.
|
---|
| 124 | *
|
---|
| 125 | * \param angle starting angle
|
---|
| 126 | *
|
---|
| 127 | * \return value distance in radian
|
---|
| 128 | */
|
---|
| 129 | float YawDistanceFrom(float angle) const;
|
---|
[2] | 130 |
|
---|
[13] | 131 | /*!
|
---|
| 132 | * \brief roll value
|
---|
| 133 | */
|
---|
| 134 | float roll;
|
---|
[2] | 135 |
|
---|
[13] | 136 | /*!
|
---|
| 137 | * \brief pitch value
|
---|
| 138 | */
|
---|
| 139 | float pitch;
|
---|
[2] | 140 |
|
---|
[13] | 141 | /*!
|
---|
| 142 | * \brief yaw value
|
---|
| 143 | */
|
---|
| 144 | float yaw;
|
---|
[2] | 145 |
|
---|
[13] | 146 | Euler &operator=(const Euler &euler);
|
---|
| 147 | };
|
---|
[2] | 148 |
|
---|
| 149 | } // end namespace core
|
---|
| 150 | } // end namespace flair
|
---|
| 151 |
|
---|
| 152 | #endif // EULER_H
|
---|