Represents a rotation in a 3 dimensional space as three Euler angles. More...
#include <EulerAngles.h>
Public Types | |
typedef AngleAxis< Scalar > | AngleAxisType |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef Quaternion< Scalar > | QuaternionType |
typedef _Scalar | Scalar |
typedef _System | System |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
Public Types inherited from Eigen::RotationBase< EulerAngles< _Scalar, _System >, 3 > | |
enum | |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef internal::traits< EulerAngles< _Scalar, _System > >::Scalar | Scalar |
typedef Matrix< Scalar, Dim, 1 > | VectorType |
Public Member Functions | |
Scalar | alpha () const |
Scalar & | alpha () |
const Vector3 & | angles () const |
Vector3 & | angles () |
Scalar | beta () const |
Scalar & | beta () |
EulerAngles () | |
EulerAngles (const Scalar &alpha, const Scalar &beta, const Scalar &gamma) | |
template<typename Derived > | |
EulerAngles (const MatrixBase< Derived > &m) | |
template<typename Derived > | |
EulerAngles (const MatrixBase< Derived > &m, bool positiveRangeAlpha, bool positiveRangeBeta, bool positiveRangeGamma) | |
template<typename Derived > | |
EulerAngles (const RotationBase< Derived, 3 > &rot) | |
template<typename Derived > | |
EulerAngles (const RotationBase< Derived, 3 > &rot, bool positiveRangeAlpha, bool positiveRangeBeta, bool positiveRangeGamma) | |
Scalar | gamma () const |
Scalar & | gamma () |
EulerAngles | inverse () const |
operator QuaternionType () const | |
EulerAngles | operator- () const |
template<typename Derived > | |
EulerAngles & | operator= (const MatrixBase< Derived > &m) |
template<typename Derived > | |
EulerAngles & | operator= (const RotationBase< Derived, 3 > &rot) |
Matrix3 | toRotationMatrix () const |
Public Member Functions inherited from Eigen::RotationBase< EulerAngles< _Scalar, _System >, 3 > | |
EIGEN_DEVICE_FUNC VectorType | _transformVector (const OtherVectorType &v) const |
EIGEN_DEVICE_FUNC const EulerAngles< _Scalar, _System > & | derived () const |
EIGEN_DEVICE_FUNC EulerAngles< _Scalar, _System > & | derived () |
EIGEN_DEVICE_FUNC EulerAngles< _Scalar, _System > | inverse () const |
EIGEN_DEVICE_FUNC RotationMatrixType | matrix () const |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > | operator* (const Translation< Scalar, Dim > &t) const |
EIGEN_DEVICE_FUNC RotationMatrixType | operator* (const UniformScaling< Scalar > &s) const |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< EulerAngles< _Scalar, _System >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
EIGEN_DEVICE_FUNC RotationMatrixType | toRotationMatrix () const |
Static Public Member Functions | |
static Vector3 | AlphaAxisVector () |
static Vector3 | BetaAxisVector () |
template<bool PositiveRangeAlpha, bool PositiveRangeBeta, bool PositiveRangeGamma, typename Derived > | |
static EulerAngles | FromRotation (const MatrixBase< Derived > &m) |
template<bool PositiveRangeAlpha, bool PositiveRangeBeta, bool PositiveRangeGamma, typename Derived > | |
static EulerAngles | FromRotation (const RotationBase< Derived, 3 > &rot) |
static Vector3 | GammaAxisVector () |
Private Attributes | |
Vector3 | m_angles |
Friends | |
std::ostream & | operator<< (std::ostream &s, const EulerAngles< Scalar, System > &eulerAngles) |
Represents a rotation in a 3 dimensional space as three Euler angles.
Euler rotation is a set of three rotation of three angles over three fixed axes, defined by the EulerSystem given as a template parameter.
Here is how intrinsic Euler angles works:
It has been proved(see Wikipedia link below) that every rotation can be represented by Euler angles, but there is no singular representation (e.g. unlike rotation matrices). Therefore, you can convert from Eigen rotation and to them (including rotation matrices, which is not called "rotations" by Eigen design).
Euler angles usually used for:
However, Euler angles are slow comparing to quaternion or matrices, because their unnatural math definition, although it's simple for human. To overcome this, this class provide easy movement from the math friendly representation to the human friendly representation, and vise-versa.
All the user need to do is a safe simple C++ type conversion, and this class take care for the math. Additionally, some axes related computation is done in compile time.
When converting some rotation to Euler angles, there are some ways you can guarantee the Euler angles ranges.
When using implicit ranges, all angles are guarantee to be in the range [-PI, +PI], unless you convert from some other Euler angles. In this case, the range is undefined (might be even less than -PI or greater than +2*PI).
When using explicit ranges, all angles are guarantee to be in the range you choose. In the range Boolean parameter, you're been ask whether you prefer the positive range or not:
This is when you have compile time ranges and you prefer to use template parameter. (e.g. for performance)
Run-time ranges are also supported.
Convenient typedefs for EulerAngles exist for float and double scalar, in a form of EulerAngles{A}{B}{C}{scalar}, e.g. EulerAnglesXYZd, EulerAnglesZYZf.
Only for positive axes{+x,+y,+z} Euler systems are have convenient typedef. If you need negative axes{-x,-y,-z}, it is recommended to create you own typedef with a word that represent what you need.
Output:
If you're want to get more idea about how Euler system work in Eigen see EulerSystem.
More information about Euler angles: https://en.wikipedia.org/wiki/Euler_angles
_Scalar | the scalar type, i.e., the type of the angles. |
_System | the EulerSystem to use, which represents the axes of rotation. |
Definition at line 111 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
typedef AngleAxis<Scalar> Eigen::EulerAngles< _Scalar, _System >::AngleAxisType |
the equivalent angle-axis type
Definition at line 123 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
typedef Matrix<Scalar,3,3> Eigen::EulerAngles< _Scalar, _System >::Matrix3 |
the equivalent rotation matrix type
Definition at line 120 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
typedef Quaternion<Scalar> Eigen::EulerAngles< _Scalar, _System >::QuaternionType |
the equivalent quaternion type
Definition at line 122 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
typedef _Scalar Eigen::EulerAngles< _Scalar, _System >::Scalar |
the scalar type of the angles
Definition at line 115 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
typedef _System Eigen::EulerAngles< _Scalar, _System >::System |
the EulerSystem to use, which represents the axes of rotation.
Definition at line 118 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
typedef Matrix<Scalar,3,1> Eigen::EulerAngles< _Scalar, _System >::Vector3 |
the equivalent 3 dimension vector type
Definition at line 121 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Default constructor without initialization.
Definition at line 148 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Constructs and initialize Euler angles(alpha
, beta
, gamma
).
Definition at line 150 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Constructs and initialize Euler angles from a 3x3 rotation matrix m
.
Definition at line 158 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Constructs and initialize Euler angles from a 3x3 rotation matrix m
, with options to choose for each angle the requested range.
If positive range is true, then the specified angle will be in the range [0, +2*PI]. Otherwise, the specified angle will be in the range [-PI, +PI].
m | The 3x3 rotation matrix to convert |
positiveRangeAlpha | If true, alpha will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeBeta | If true, beta will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeGamma | If true, gamma will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
Definition at line 172 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Constructs and initialize Euler angles from a rotation rot
.
rot
is an EulerAngles. If rot is an EulerAngles, expected EulerAngles range is undefined. (Use other functions here for enforcing range if this effect is desired) Definition at line 188 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Constructs and initialize Euler angles from a rotation rot
, with options to choose for each angle the requested range.
If positive range is true, then the specified angle will be in the range [0, +2*PI]. Otherwise, the specified angle will be in the range [-PI, +PI].
rot | The 3x3 rotation matrix to convert |
positiveRangeAlpha | If true, alpha will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeBeta | If true, beta will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeGamma | If true, gamma will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
Definition at line 202 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 217 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 219 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inlinestatic |
Definition at line 126 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 212 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 214 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 222 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 224 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inlinestatic |
Definition at line 132 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inlinestatic |
Constructs and initialize Euler angles from a 3x3 rotation matrix m
, with options to choose for each angle the requested range (only in compile time).
If positive range is true, then the specified angle will be in the range [0, +2*PI]. Otherwise, the specified angle will be in the range [-PI, +PI].
m | The 3x3 rotation matrix to convert |
positiveRangeAlpha | If true, alpha will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeBeta | If true, beta will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeGamma | If true, gamma will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
Definition at line 265 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inlinestatic |
Constructs and initialize Euler angles from a rotation rot
, with options to choose for each angle the requested range (only in compile time).
If positive range is true, then the specified angle will be in the range [0, +2*PI]. Otherwise, the specified angle will be in the range [-PI, +PI].
rot | The 3x3 rotation matrix to convert |
positiveRangeAlpha | If true, alpha will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeBeta | If true, beta will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
positiveRangeGamma | If true, gamma will be in [0, 2*PI]. Otherwise, in [-PI, +PI]. |
Definition at line 291 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 227 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 229 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inlinestatic |
Definition at line 138 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 234 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Convert the Euler angles to quaternion.
Definition at line 337 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 244 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Set *this
from a rotation matrix(i.e. pure orthogonal matrix with determinant of +1).
Definition at line 312 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Set *this
from a rotation.
Definition at line 323 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
inline |
Definition at line 331 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
friend |
Definition at line 345 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.
|
private |
Definition at line 144 of file unsupported/Eigen/src/EulerAngles/EulerAngles.h.