#include </home/thodoris/src/ompl/demos/multicopter/CommonMath/Rotation.h>
Public Member Functions | |
| Rotation (double a, double b, double c, double d) | |
| Constructor given a unit quaternion. | |
| Rotation (Rotation const &in) | |
| Copy constructor. | |
| Rotation | Inverse (void) const |
| void | Normalise (void) |
| This makes sure the quaternion is a unit quaternion. | |
| Rotation & | operator= (const Rotation &other) |
| Rotation | operator* (const Rotation &r1) const |
| Rotation multiplication: r2*r1, corresponds to a rotation r1 followed by rotation r2. | |
| Vec3 | operator* (const Vec3 &vec) const |
| Rotate a vector forward. | |
| Vec3 | ToRotationVector (void) const |
| Vec3 | ToVectorPartOfQuaternion (void) const |
| Returns the vector part of the quaternion representing this rotation. | |
| void | ToEulerYPR (double &y, double &p, double &r) const |
| Returns the Euler angles yaw, pitch, and roll representing this rotation. | |
| Vec3 | ToEulerYPR (void) const |
| Returns the Euler angles yaw, pitch, and roll representing this rotation. | |
| void | PrintRotationMatrix (void) |
| For debugging. | |
| double & | operator[] (unsigned const i) |
| const double & | operator[] (unsigned const i) const |
| void | GetRotationMatrix (double R[9]) const |
Static Public Member Functions | |
| static Rotation | Identity (void) |
| static Rotation | FromRotationVector (const Vec3 rotVec) |
| static Rotation | FromAxisAngle (const Vec3 &unitVector, const double &angle) |
| static Rotation | FromEulerYPR (const double &y, const double &p, const double &r) |
| Returns a Rotation object given Euler angles yaw, pitch, and roll. | |
| static Rotation | FromVectorPartOfQuaternion (const Vec3 in) |
| Returns a Rotation object given the three elements of the vector part of a unit quaternion. | |
Detailed Description
A way of representing attitudes, based on the Euler-Rodriguez symmetric parameters (ERSP) a.k.a. "quaternion of rotation".
Note that you should call Normalise() every once in a while, so that you're rotations remain orthonormal.
BEWARE: Everyone defines rotations differently, take care when interpreting the internals, or using it. Construct some test cases and make sure the numbers make sense.
Definition at line 37 of file Rotation.h.
Constructor & Destructor Documentation
◆ Rotation() [1/3]
|
inline |
Definition at line 43 of file Rotation.h.
◆ Rotation() [2/3]
|
inline |
Constructor given a unit quaternion.
Definition at line 48 of file Rotation.h.
◆ Rotation() [3/3]
|
inline |
Copy constructor.
Definition at line 57 of file Rotation.h.
Member Function Documentation
◆ FromAxisAngle()
|
inlinestatic |
Returns a Rotation object given a unit vector and angle. The unit vector is the rotation axis and the angle is the angle of rotation in radians.
Definition at line 104 of file Rotation.h.
◆ FromEulerYPR()
|
inlinestatic |
Returns a Rotation object given Euler angles yaw, pitch, and roll.
Definition at line 111 of file Rotation.h.
◆ FromRotationVector()
|
inlinestatic |
Returns a Rotation object given a vector, where the direction of the vector is the rotation axis and the magnitude of the vector is the angle of rotation in radians.
Definition at line 93 of file Rotation.h.
◆ FromVectorPartOfQuaternion()
|
inlinestatic |
Returns a Rotation object given the three elements of the vector part of a unit quaternion.
Definition at line 122 of file Rotation.h.
◆ GetRotationMatrix()
|
inline |
Returns the rotation matrix corresponding to this rotation where Matrix = [[R[0], R[1], R[2]], [R[3], R[4], R[5]], [R[6], R[7], R[8]]]
Definition at line 235 of file Rotation.h.
◆ Identity()
|
inlinestatic |
Definition at line 65 of file Rotation.h.
◆ Inverse()
|
inline |
Definition at line 70 of file Rotation.h.
◆ Normalise()
|
inline |
This makes sure the quaternion is a unit quaternion.
Definition at line 76 of file Rotation.h.
◆ operator*() [1/2]
|
inline |
Rotation multiplication: r2*r1, corresponds to a rotation r1 followed by rotation r2.
Definition at line 144 of file Rotation.h.
◆ operator*() [2/2]
Rotate a vector forward.
Definition at line 155 of file Rotation.h.
◆ operator=()
|
inline |
Definition at line 131 of file Rotation.h.
◆ operator[]() [1/2]
|
inline |
Definition at line 220 of file Rotation.h.
◆ operator[]() [2/2]
|
inline |
Definition at line 224 of file Rotation.h.
◆ PrintRotationMatrix()
|
inline |
For debugging.
Definition at line 206 of file Rotation.h.
◆ ToEulerYPR() [1/2]
|
inline |
Returns the Euler angles yaw, pitch, and roll representing this rotation.
Definition at line 188 of file Rotation.h.
◆ ToEulerYPR() [2/2]
|
inline |
Returns the Euler angles yaw, pitch, and roll representing this rotation.
Definition at line 198 of file Rotation.h.
◆ ToRotationVector()
|
inline |
Returns the rotation vector corresponding to this rotation, where the returned vector is the rotation axis and its magnitude is the rotation angle.
Definition at line 164 of file Rotation.h.
◆ ToVectorPartOfQuaternion()
|
inline |
Returns the vector part of the quaternion representing this rotation.
Definition at line 178 of file Rotation.h.
The documentation for this class was generated from the following file:
- demos/multicopter/CommonMath/Rotation.h