|
| EulerAngles () |
| Default constructor without initialization. More...
|
|
| EulerAngles (const Scalar &alpha, const Scalar &beta, const Scalar &gamma) |
| Constructs and initialize Euler angles(alpha , beta , gamma ). More...
|
|
template<typename Derived > |
| EulerAngles (const MatrixBase< Derived > &m) |
| Constructs and initialize Euler angles from a 3x3 rotation matrix m . More...
|
|
template<typename Derived > |
| EulerAngles (const MatrixBase< Derived > &m, bool positiveRangeAlpha, bool positiveRangeBeta, bool positiveRangeGamma) |
| Constructs and initialize Euler angles from a 3x3 rotation matrix m , with options to choose for each angle the requested range. More...
|
|
template<typename Derived > |
| EulerAngles (const RotationBase< Derived, 3 > &rot) |
| Constructs and initialize Euler angles from a rotation rot . More...
|
|
template<typename Derived > |
| EulerAngles (const RotationBase< Derived, 3 > &rot, bool positiveRangeAlpha, bool positiveRangeBeta, bool positiveRangeGamma) |
| Constructs and initialize Euler angles from a rotation rot , with options to choose for each angle the requested range. More...
|
|
const Vector3 & | angles () const |
|
Vector3 & | angles () |
|
Scalar | alpha () const |
|
Scalar & | alpha () |
|
Scalar | beta () const |
|
Scalar & | beta () |
|
Scalar | gamma () const |
|
Scalar & | gamma () |
|
EulerAngles | inverse () const |
|
EulerAngles | operator- () const |
|
template<typename Derived > |
EulerAngles & | operator= (const MatrixBase< Derived > &m) |
| Set *this from a rotation matrix(i.e. More...
|
|
template<typename Derived > |
EulerAngles & | operator= (const RotationBase< Derived, 3 > &rot) |
| Set *this from a rotation. More...
|
|
Matrix3 | toRotationMatrix () const |
|
| operator QuaternionType () const |
| Convert the Euler angles to quaternion. More...
|
|
EIGEN_DEVICE_FUNC const EulerAngles< _Scalar, _System > & | derived () const |
|
EIGEN_DEVICE_FUNC EulerAngles< _Scalar, _System > & | derived () |
|
EIGEN_DEVICE_FUNC RotationMatrixType | toRotationMatrix () const |
|
EIGEN_DEVICE_FUNC RotationMatrixType | matrix () const |
|
EIGEN_DEVICE_FUNC EulerAngles< _Scalar, _System > | inverse () 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 VectorType | _transformVector (const OtherVectorType &v) const |
|
template<typename _Scalar, class _System>
class Eigen::EulerAngles< _Scalar, _System >
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:
- first, rotate the axes system over the alpha axis in angle alpha
- then, rotate the axes system over the beta axis(which was rotated in the first stage) in angle beta
- then, rotate the axes system over the gamma axis(which was rotated in the two stages above) in angle gamma
- Note
- This class support only intrinsic Euler angles for simplicity, see EulerSystem how to easily overcome this for extrinsic systems.
Rotation representation and conversions
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:
- convenient human representation of rotation, especially in interactive GUI.
- gimbal systems and robotics
- efficient encoding(i.e. 3 floats only) of rotation for network protocols.
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.
Euler angles ranges in conversions
When converting some rotation to Euler angles, there are some ways you can guarantee the Euler angles ranges.
implicit 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).
- See also
- EulerAngles(const MatrixBase<Derived>&)
-
EulerAngles(const RotationBase<Derived, 3>&)
explicit ranges
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:
- true - force the range between [0, +2*PI]
- false - force the range between [-PI, +PI]
compile time ranges
This is when you have compile time ranges and you prefer to use template parameter. (e.g. for performance)
- See also
- FromRotation()
run-time time ranges
Run-time ranges are also supported.
- See also
- EulerAngles(const MatrixBase<Derived>&, bool, bool, bool)
-
EulerAngles(const RotationBase<Derived, 3>&, bool, bool, bool)
Convenient user typedefs
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.
Example
Output:
Additional reading
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
- Template Parameters
-
_Scalar | the scalar type, i.e., the type of the angles. |
_System | the EulerSystem to use, which represents the axes of rotation. |