My Project
Public Member Functions | Public Attributes | List of all members
Pose Class Reference

Pose representation derived from the Rotation class More...

#include <Pose.h>

Inheritance diagram for Pose:
Rotation

Public Member Functions

void Output () const
 
 Pose ()
 
 Pose (const cv::Mat &tra, const cv::Mat &rot, RotationType t)
 
 Pose (const cv::Mat &mat)
 
 Pose (const Pose &p)
 
void Reset ()
 
void SetMatrix (const cv::Mat &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 GetMatrix (cv::Mat &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 Transpose ()
 
void Invert ()
 
void Mirror (bool x, bool y, bool z)
 
void SetTranslation (const cv::Mat &tra)
 
void SetTranslation (const double *tra)
 
void SetTranslation (const double x, const double y, const double z)
 
void GetTranslation (cv::Mat &tra) const
 
Poseoperator= (const Pose &p)
 
- Public Member Functions inherited from Rotation
 Rotation (const Rotation &r)
 
 Rotation (const cv::Mat &data, RotationType t)
 Constructor. More...
 
Rotationoperator= (const Rotation &p)
 
Rotationoperator+= (const Rotation &v)
 
void Transpose ()
 
void Mirror (bool x, bool y, bool z)
 Mirrors the rotation in selected directions. More...
 
void Reset ()
 Resets the rotation into identity.
 
void SetQuaternion (const cv::Mat &mat)
 Sets the rotation from given quaternion. More...
 
void SetQuaternion (const double *quat)
 Sets the rotation from given quaternion. More...
 
void SetEuler (const cv::Mat &mat)
 Sets the rotation from given Euler angles. More...
 
void SetRodriques (const cv::Mat &mat)
 Sets the rotation from given rotation vector. More...
 
void SetMatrix (const cv::Mat &mat)
 Sets the rotation from given rotation matrix. 3x3 and 4x4 matrices are allowed. More...
 
void GetMatrix (cv::Mat &mat) const
 Returns the rotation in matrix form. 3x3 and 4x4 matrices are allowed. More...
 
void GetRodriques (cv::Mat &mat) const
 Returns the rotation in rotation vector form. More...
 
void GetEuler (cv::Mat &mat) const
 Returns the rotation in Euler angles. More...
 
void GetQuaternion (cv::Mat &mat) const
 Returns the rotation in quaternion form. More...
 

Public Attributes

double translation [4]
 
cv::Mat translation_mat
 

Additional Inherited Members

- Public Types inherited from Rotation
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 Public Member Functions inherited from Rotation
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...
 
- Protected Attributes inherited from Rotation
double quaternion [4]
 
cv::Mat quaternion_mat
 

Detailed Description

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.

Definition at line 52 of file Pose.h.

Constructor & Destructor Documentation

◆ Pose() [1/4]

Pose ( )

Constructor

◆ Pose() [2/4]

Pose ( const cv::Mat &  tra,
const cv::Mat &  rot,
RotationType  t 
)

Constructor using the given translation and rotation elements

Parameters
traColumn vector containing three translation elements
rotHandled using the Rotation class
tHandled using the Rotation class

◆ Pose() [3/4]

Pose ( const cv::Mat &  mat)

Constructor with 3x3, 3x4 or 4x4 matrix representation

Parameters
matA 3x3 rotation matrix or 3x4 / 4x4 transformation matrix

◆ Pose() [4/4]

Pose ( const Pose p)

Copy constructor

Member Function Documentation

◆ GetMatrix()

void GetMatrix ( cv::Mat &  mat) const

Get the transformation into the given matrix mat

Parameters
matA 3x3 rotation matrix or 3x4 / 4x4 transformation matrix

◆ GetMatrixGL()

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)

Parameters
glOpenGL 4x4 transformation matrix elements in column-order

◆ GetTranslation()

void GetTranslation ( cv::Mat &  tra) const

Get the translation part from the Pose

Parameters
traColumn vector where the three translation elements are filled in

◆ Invert()

void Invert ( )

Invert the pose

◆ Mirror()

void Mirror ( bool  x,
bool  y,
bool  z 
)

Mirror the Pose

Parameters
xIf true mirror the x-coordinates
yIf true mirror the y-coordinates
zIf true mirror the z-coordinates

◆ operator=()

Pose& operator= ( const Pose p)

Assignment operator for copying Pose class

◆ Output()

void Output ( ) const

Output for debugging purposes

◆ Reset()

void Reset ( )

Reset the pose

◆ SetMatrix()

void SetMatrix ( const cv::Mat &  mat)

Set the transformation from the given matrix mat

Parameters
matA 3x3 rotation matrix or 3x4 / 4x4 transformation matrix

◆ SetMatrixGL()

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)

Parameters
glOpenGL 4x4 transformation matrix elements in column-order

◆ SetTranslation() [1/3]

void SetTranslation ( const cv::Mat &  tra)

Set the translation part for the Pose

Parameters
traColumn vector containing three translation elements

◆ SetTranslation() [2/3]

void SetTranslation ( const double *  tra)

Set the translation part for the Pose

Parameters
traArray containing three translation elements

◆ SetTranslation() [3/3]

void SetTranslation ( const double  x,
const double  y,
const double  z 
)

Set the translation part for the Pose

◆ Transpose()

void Transpose ( )

Transpose the transformation


The documentation for this class was generated from the following file: