Rotation structure and transformations between different parameterizations.
More...
#include <Rotation.h>
|
enum | RotationType { QUAT
, MAT
, EUL
, ROD
} |
| Rotation can be represented in four ways: quaternion (QUAT), matrix (MAT), euler angles (EUL) and exponential map (ROD).
|
|
|
static void | MirrorMat (cv::Mat &mat, bool x, bool y, bool z) |
| Simple function to mirror a rotation matrix in different directions. More...
|
|
static void | Mat9ToRod (double *mat, double *rod) |
| Converts 3x3 rotation matrix into Rodriques representation. More...
|
|
static void | RodToMat9 (const double *rod, double *mat) |
| Converts 3x1 rotation vector into 3x3 rotation matrix using Rodriques' formula. More...
|
|
static void | QuatInv (const double *q, double *qi) |
| Inverts unit quaternion. More...
|
|
static void | QuatNorm (double *q) |
| Normalizes a quaternion. More...
|
|
static void | QuatMul (const double *q1, const double *q2, double *q3) |
| Quaternion multiplication. More...
|
|
static void | QuatToMat9 (const double *quat, double *mat) |
| Converts a rotation described by a quaternion into 3x3 rotation matrix. 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 | QuatToEul (const double *q, double *eul) |
| Converts a rotation described by a quaternion into Euler angles. More...
|
|
static void | Mat9ToQuat (const double *mat, double *quat) |
| Converts a 3x3 rotation martix into quaternion form. More...
|
|
static void | EulToQuat (const double *eul, double *quat) |
| Converts a rotation described by Euler angles into quaternion form. More...
|
|
|
double | quaternion [4] |
|
cv::Mat | quaternion_mat |
|
Rotation structure and transformations between different parameterizations.
Definition at line 44 of file Rotation.h.
◆ Rotation()
Constructor.
- Parameters
-
data | Rotation data stored in cv::Mat. With RotationType::MAT both 3x3 and 4x4 matrices are allowed. |
t | Rotation type that corresponds to data. |
◆ EulToQuat()
static void 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. |
◆ GetEuler()
void GetEuler |
( |
cv::Mat & |
mat | ) |
const |
Returns the rotation in Euler angles.
- Parameters
-
mat | The rotation is stored here (3x1 cv::Mat). |
◆ GetMatrix()
void GetMatrix |
( |
cv::Mat & |
mat | ) |
const |
Returns the rotation in matrix form. 3x3 and 4x4 matrices are allowed.
- Parameters
-
mat | The rotation is stored here. |
◆ GetQuaternion()
void GetQuaternion |
( |
cv::Mat & |
mat | ) |
const |
Returns the rotation in quaternion form.
- Parameters
-
mat | The rotation is stored here (4x1 cv::Mat). |
◆ GetRodriques()
void GetRodriques |
( |
cv::Mat & |
mat | ) |
const |
Returns the rotation in rotation vector form.
- Parameters
-
mat | The rotation is stored here (3x1 cv::Mat). |
◆ Mat9ToQuat()
static void Mat9ToQuat |
( |
const double * |
mat, |
|
|
double * |
quat |
|
) |
| |
|
static |
Converts a 3x3 rotation martix into quaternion form.
- Parameters
-
mat | 3x3 rotation matrix. |
quat | Resulting quaternion. |
◆ Mat9ToRod()
static void Mat9ToRod |
( |
double * |
mat, |
|
|
double * |
rod |
|
) |
| |
|
static |
Converts 3x3 rotation matrix into Rodriques representation.
- Parameters
-
mat | 3x3 rotation matrix. |
rod | Resulting 3x1 rotation vector. |
◆ Mirror()
void Mirror |
( |
bool |
x, |
|
|
bool |
y, |
|
|
bool |
z |
|
) |
| |
Mirrors the rotation in selected directions.
- Parameters
-
◆ MirrorMat()
static void MirrorMat |
( |
cv::Mat & |
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 |
|
◆ QuatInv()
static void QuatInv |
( |
const double * |
q, |
|
|
double * |
qi |
|
) |
| |
|
static |
Inverts unit quaternion.
- Parameters
-
q | Unit quaternion to be inverted. |
qi | Resulting quaternion. |
◆ QuatMul()
static void QuatMul |
( |
const double * |
q1, |
|
|
const double * |
q2, |
|
|
double * |
q3 |
|
) |
| |
|
static |
Quaternion multiplication.
- Parameters
-
q1 |
|
q2 |
|
q3 | Resulting quaternion. |
◆ QuatNorm()
static void QuatNorm |
( |
double * |
q | ) |
|
|
static |
Normalizes a quaternion.
- Parameters
-
q | Quaternion to be normalized. |
◆ QuatToEul()
static void 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. |
◆ QuatToMat16()
static void 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. |
◆ QuatToMat9()
static void 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. |
◆ RodToMat9()
static void RodToMat9 |
( |
const 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. |
◆ SetEuler()
void SetEuler |
( |
const cv::Mat & |
mat | ) |
|
Sets the rotation from given Euler angles.
- Parameters
-
mat | Input Euler angles (3x1 cv::Mat). |
◆ SetMatrix()
void SetMatrix |
( |
const cv::Mat & |
mat | ) |
|
Sets the rotation from given rotation matrix. 3x3 and 4x4 matrices are allowed.
- Parameters
-
mat | Input rotation matrix (3x3 or 4x4 cv::Mat). |
◆ SetQuaternion() [1/2]
void SetQuaternion |
( |
const cv::Mat & |
mat | ) |
|
Sets the rotation from given quaternion.
- Parameters
-
mat | Input quaternion (4x1 cv::Mat). |
◆ SetQuaternion() [2/2]
void SetQuaternion |
( |
const double * |
quat | ) |
|
Sets the rotation from given quaternion.
- Parameters
-
mat | Input quaternion (4x1 double array). |
◆ SetRodriques()
void SetRodriques |
( |
const cv::Mat & |
mat | ) |
|
Sets the rotation from given rotation vector.
- Parameters
-
mat | Input rotation vector (3x1 cv::Mat). |
The documentation for this class was generated from the following file: