Rotation structure and transformations between different parameterizations.
More...
#include <Rotation.h>
|
static void | EulToQuat (const double *eul, double *quat) |
| Converts a rotation described by Euler angles into quaternion form. More...
|
|
static void | Mat9ToQuat (const double *mat, double *quat) |
| Converts a 3x3 rotation martix into quaternion form. More...
|
|
static void | Mat9ToRod (double *mat, double *rod) |
| Converts 3x3 rotation matrix into Rodriques representation. More...
|
|
static void | MirrorMat (CvMat *mat, bool x, bool y, bool z) |
| Simple function to mirror a rotation matrix in different directions. More...
|
|
static void | QuatInv (const double *q, double *qi) |
| Inverts unit quaternion. More...
|
|
static void | QuatMul (const double *q1, const double *q2, double *q3) |
| Quaternion multiplication. More...
|
|
static void | QuatNorm (double *q) |
| Normalizes a quaternion. More...
|
|
static void | QuatToEul (const double *q, double *eul) |
| Converts a rotation described by a quaternion into Euler angles. More...
|
|
static void | QuatToMat16 (const double *quat, double *mat) |
| Converts a rotation described by a quaternion into 4x4 OpenGL-like transformation matrix. The translation part is not altered. More...
|
|
static void | QuatToMat9 (const double *quat, double *mat) |
| Converts a rotation described by a quaternion into 3x3 rotation matrix. More...
|
|
static void | RodToMat9 (double *rod, double *mat) |
| Converts 3x1 rotation vector into 3x3 rotation matrix using Rodriques' formula. More...
|
|
Rotation structure and transformations between different parameterizations.
Definition at line 43 of file Rotation.h.
Rotation can be represented in four ways: quaternion (QUAT), matrix (MAT), euler angles (EUL) and exponential map (ROD).
Enumerator |
---|
QUAT |
|
MAT |
|
EUL |
|
ROD |
|
Definition at line 53 of file Rotation.h.
alvar::Rotation::Rotation |
( |
| ) |
|
alvar::Rotation::Rotation |
( |
const Rotation & |
r | ) |
|
Constructor.
- Parameters
-
data | Rotation data stored in CvMat. With RotationType::MAT both 3x3 and 4x4 matrices are allowed. |
t | Rotation type that corresponds to data. |
Definition at line 43 of file Rotation.cpp.
void alvar::Rotation::EulToQuat |
( |
const double * |
eul, |
|
|
double * |
quat |
|
) |
| |
|
static |
Converts a rotation described by Euler angles into quaternion form.
- Parameters
-
eul | Rotation in Euler angles. |
quat | Resulting quaternion. |
Definition at line 271 of file Rotation.cpp.
void alvar::Rotation::GetEuler |
( |
CvMat * |
mat | ) |
const |
Returns the rotation in Euler angles.
- Parameters
-
mat | The rotation is stored here (3x1 CvMat). |
Definition at line 348 of file Rotation.cpp.
void alvar::Rotation::GetMatrix |
( |
CvMat * |
mat | ) |
const |
Returns the rotation in matrix form. 3x3 and 4x4 matrices are allowed.
- Parameters
-
mat | The rotation is stored here. |
Definition at line 331 of file Rotation.cpp.
void alvar::Rotation::GetQuaternion |
( |
CvMat * |
mat | ) |
const |
Returns the rotation in quaternion form.
- Parameters
-
mat | The rotation is stored here (4x1 CvMat). |
Definition at line 353 of file Rotation.cpp.
void alvar::Rotation::GetRodriques |
( |
CvMat * |
mat | ) |
const |
Returns the rotation in rotation vector form.
- Parameters
-
mat | The rotation is stored here (3x1 CvMat). |
Definition at line 341 of file Rotation.cpp.
void alvar::Rotation::Mat9ToQuat |
( |
const double * |
mat, |
|
|
double * |
quat |
|
) |
| |
|
static |
Converts a 3x3 rotation martix into quaternion form.
- Parameters
-
mat | 3x3 rotation matrix. |
quat | Resulting quaternion. |
Definition at line 257 of file Rotation.cpp.
void alvar::Rotation::Mat9ToRod |
( |
double * |
mat, |
|
|
double * |
rod |
|
) |
| |
|
static |
Converts 3x3 rotation matrix into Rodriques representation.
- Parameters
-
mat | 3x3 rotation matrix. |
rod | Resulting 3x1 rotation vector. |
Definition at line 99 of file Rotation.cpp.
void alvar::Rotation::Mirror |
( |
bool |
x, |
|
|
bool |
y, |
|
|
bool |
z |
|
) |
| |
Mirrors the rotation in selected directions.
- Parameters
-
Definition at line 85 of file Rotation.cpp.
void alvar::Rotation::MirrorMat |
( |
CvMat * |
mat, |
|
|
bool |
x, |
|
|
bool |
y, |
|
|
bool |
z |
|
) |
| |
|
static |
Simple function to mirror a rotation matrix in different directions.
- Parameters
-
mat | Matrix to be mirrored. |
x | |
y | |
z | |
Definition at line 75 of file Rotation.cpp.
void alvar::Rotation::QuatInv |
( |
const double * |
q, |
|
|
double * |
qi |
|
) |
| |
|
static |
Inverts unit quaternion.
- Parameters
-
q | Unit quaternion to be inverted. |
qi | Resulting quaternion. |
Definition at line 115 of file Rotation.cpp.
void alvar::Rotation::QuatMul |
( |
const double * |
q1, |
|
|
const double * |
q2, |
|
|
double * |
q3 |
|
) |
| |
|
static |
Quaternion multiplication.
- Parameters
-
q1 | |
q2 | |
q3 | Resulting quaternion. |
Definition at line 132 of file Rotation.cpp.
void alvar::Rotation::QuatNorm |
( |
double * |
q | ) |
|
|
static |
Normalizes a quaternion.
- Parameters
-
q | Quaternion to be normalized. |
Definition at line 123 of file Rotation.cpp.
void alvar::Rotation::QuatToEul |
( |
const double * |
q, |
|
|
double * |
eul |
|
) |
| |
|
static |
Converts a rotation described by a quaternion into Euler angles.
- Parameters
-
q | Rotation in quaternion form. |
eul | Resulting Euler angles. |
Definition at line 221 of file Rotation.cpp.
void alvar::Rotation::QuatToMat16 |
( |
const double * |
quat, |
|
|
double * |
mat |
|
) |
| |
|
static |
Converts a rotation described by a quaternion into 4x4 OpenGL-like transformation matrix. The translation part is not altered.
- Parameters
-
quat | Rotation in quaternion form. |
mat | Resulting 4x4 transformation matrix. |
Definition at line 185 of file Rotation.cpp.
void alvar::Rotation::QuatToMat9 |
( |
const double * |
quat, |
|
|
double * |
mat |
|
) |
| |
|
static |
Converts a rotation described by a quaternion into 3x3 rotation matrix.
- Parameters
-
quat | Rotation in quaternion form. |
mat | Corresponding 3x3 rotation matrix. |
Definition at line 152 of file Rotation.cpp.
void alvar::Rotation::Reset |
( |
| ) |
|
Resets the rotation into identity.
Definition at line 94 of file Rotation.cpp.
void alvar::Rotation::RodToMat9 |
( |
double * |
rod, |
|
|
double * |
mat |
|
) |
| |
|
static |
Converts 3x1 rotation vector into 3x3 rotation matrix using Rodriques' formula.
- Parameters
-
rod | 3x1 rotation vector. |
Resulting | 3x3 rotation matrix. |
Definition at line 107 of file Rotation.cpp.
void alvar::Rotation::SetEuler |
( |
const CvMat * |
mat | ) |
|
Sets the rotation from given Euler angles.
- Parameters
-
mat | Input Euler angles (3x1 CvMat). |
Definition at line 309 of file Rotation.cpp.
void alvar::Rotation::SetMatrix |
( |
const CvMat * |
mat | ) |
|
Sets the rotation from given rotation matrix. 3x3 and 4x4 matrices are allowed.
- Parameters
-
mat | Input rotation matrix (3x3 or 4x4 CvMat). |
Definition at line 321 of file Rotation.cpp.
void alvar::Rotation::SetQuaternion |
( |
CvMat * |
mat | ) |
|
Sets the rotation from given quaternion.
- Parameters
-
mat | Input quaternion (4x1 CvMat). |
Definition at line 294 of file Rotation.cpp.
void alvar::Rotation::SetQuaternion |
( |
const double * |
quat | ) |
|
Sets the rotation from given quaternion.
- Parameters
-
mat | Input quaternion (4x1 double array). |
Definition at line 300 of file Rotation.cpp.
void alvar::Rotation::SetRodriques |
( |
const CvMat * |
mat | ) |
|
Sets the rotation from given rotation vector.
- Parameters
-
mat | Input rotation vector (3x1 CvMat). |
Definition at line 314 of file Rotation.cpp.
void alvar::Rotation::Transpose |
( |
| ) |
|
double alvar::Rotation::quaternion[4] |
CvMat alvar::Rotation::quaternion_mat |
The documentation for this class was generated from the following files: