Pose representation derived from the Rotation class More...
#include <Pose.h>
Public Member Functions | |
void | GetMatrix (CvMat *mat) const |
void | GetMatrixGL (double gl[16], bool mirror=true) |
Get the transformation matrix representation of the Pose using OpenGL's transposed format. Note, that by default this also mirrors both the y- and z-axis (see Camera and Pose for more information) More... | |
void | GetTranslation (CvMat *tra) const |
void | Invert () |
void | Mirror (bool x, bool y, bool z) |
Pose & | operator= (const Pose &p) |
void | Output () const |
Pose () | |
Pose (CvMat *tra, CvMat *rot, RotationType t) | |
Pose (CvMat *mat) | |
Pose (const Pose &p) | |
void | Reset () |
void | SetMatrix (const CvMat *mat) |
void | SetMatrixGL (double gl[16], bool mirror=true) |
Set the Pose using OpenGL's transposed format. Note, that by default this also mirrors both the y- and z-axis (see Camera and Pose for more information) More... | |
void | SetTranslation (const CvMat *tra) |
void | SetTranslation (const double *tra) |
void | SetTranslation (const double x, const double y, const double z) |
void | Transpose () |
![]() | |
void | GetEuler (CvMat *mat) const |
Returns the rotation in Euler angles. More... | |
void | GetMatrix (CvMat *mat) const |
Returns the rotation in matrix form. 3x3 and 4x4 matrices are allowed. More... | |
void | GetQuaternion (CvMat *mat) const |
Returns the rotation in quaternion form. More... | |
void | GetRodriques (CvMat *mat) const |
Returns the rotation in rotation vector form. More... | |
void | Mirror (bool x, bool y, bool z) |
Mirrors the rotation in selected directions. More... | |
Rotation & | operator+= (const Rotation &v) |
Rotation & | operator= (const Rotation &p) |
void | Reset () |
Resets the rotation into identity. More... | |
Rotation () | |
Rotation (const Rotation &r) | |
Rotation (CvMat *data, RotationType t) | |
Constructor. More... | |
void | SetEuler (const CvMat *mat) |
Sets the rotation from given Euler angles. More... | |
void | SetMatrix (const CvMat *mat) |
Sets the rotation from given rotation matrix. 3x3 and 4x4 matrices are allowed. More... | |
void | SetQuaternion (CvMat *mat) |
Sets the rotation from given quaternion. More... | |
void | SetQuaternion (const double *quat) |
Sets the rotation from given quaternion. More... | |
void | SetRodriques (const CvMat *mat) |
Sets the rotation from given rotation vector. More... | |
void | Transpose () |
Public Attributes | |
double | translation [4] |
CvMat | translation_mat |
![]() | |
double | quaternion [4] |
CvMat | quaternion_mat |
Additional Inherited Members | |
![]() | |
enum | RotationType { QUAT, MAT, EUL, ROD } |
Rotation can be represented in four ways: quaternion (QUAT), matrix (MAT), euler angles (EUL) and exponential map (ROD). More... | |
![]() | |
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... | |
Pose representation derived from the Rotation class
The rotation part of the transformation is handled by Rotation . The translation part is stored internally using homogeneous 4-vector.
Internally in ALVAR we assume coordinate system where 'x' is right, 'y' is down, and 'z' is forward. However the SetMatrixGL and GetMatrixGL change the pose to support coordinates commonly used in OpenGL: 'x' is right, 'y' is up, and 'z' is backward.
alvar::Pose::Pose | ( | CvMat * | tra, |
CvMat * | rot, | ||
RotationType | t | ||
) |
alvar::Pose::Pose | ( | CvMat * | mat | ) |
void alvar::Pose::GetMatrix | ( | CvMat * | mat | ) | const |
void alvar::Pose::GetMatrixGL | ( | double | gl[16], |
bool | mirror = true |
||
) |
Get the transformation matrix representation of the Pose using OpenGL's transposed format. Note, that by default this also mirrors both the y- and z-axis (see Camera and Pose for more information)
gl | OpenGL 4x4 transformation matrix elements in column-order |
void alvar::Pose::GetTranslation | ( | CvMat * | tra | ) | const |
void alvar::Pose::Invert | ( | ) |
void alvar::Pose::Mirror | ( | bool | x, |
bool | y, | ||
bool | z | ||
) |
void alvar::Pose::Output | ( | ) | const |
void alvar::Pose::Reset | ( | ) |
Reset the pose
void alvar::Pose::SetMatrix | ( | const CvMat * | mat | ) |
void alvar::Pose::SetMatrixGL | ( | double | gl[16], |
bool | mirror = true |
||
) |
void alvar::Pose::SetTranslation | ( | const CvMat * | tra | ) |
Set the translation part for the Pose
tra | Column vector containing three translation elements |
void alvar::Pose::SetTranslation | ( | const double * | tra | ) |
void alvar::Pose::SetTranslation | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
void alvar::Pose::Transpose | ( | ) |