Public Member Functions | Public Attributes | List of all members
alvar::Pose Class Reference

Pose representation derived from the Rotation class More...

#include <Pose.h>

Inheritance diagram for alvar::Pose:
Inheritance graph
[legend]

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)
 
Poseoperator= (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 ()
 
- Public Member Functions inherited from alvar::Rotation
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...
 
Rotationoperator+= (const Rotation &v)
 
Rotationoperator= (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
 
- Public Attributes inherited from alvar::Rotation
double quaternion [4]
 
CvMat quaternion_mat
 

Additional Inherited Members

- Public Types inherited from alvar::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). More...
 
- Static Public Member Functions inherited from alvar::Rotation
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...
 

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.

Examples:
SampleCamCalib.cpp, SampleMarkerCreator.cpp, SampleMarkerDetector.cpp, SampleMarkerHide.cpp, SampleMarkerlessDetector.cpp, SampleMultiMarker.cpp, SampleMultiMarkerBundle.cpp, and SamplePointcloud.cpp.

Definition at line 50 of file Pose.h.

Constructor & Destructor Documentation

alvar::Pose::Pose ( )

Constructor

Definition at line 36 of file Pose.cpp.

alvar::Pose::Pose ( CvMat *  tra,
CvMat *  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

Definition at line 42 of file Pose.cpp.

alvar::Pose::Pose ( CvMat *  mat)

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

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

Definition at line 52 of file Pose.cpp.

alvar::Pose::Pose ( const Pose p)

Copy constructor

Definition at line 64 of file Pose.cpp.

Member Function Documentation

void alvar::Pose::GetMatrix ( CvMat *  mat) const

Get the transformation into the given matrix mat

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

Definition at line 91 of file Pose.cpp.

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)

Parameters
glOpenGL 4x4 transformation matrix elements in column-order
Examples:
SampleMarkerDetector.cpp, SampleMarkerHide.cpp, SampleMarkerlessDetector.cpp, and SamplePointcloud.cpp.

Definition at line 104 of file Pose.cpp.

void alvar::Pose::GetTranslation ( CvMat *  tra) const

Get the translation part from the Pose

Parameters
traColumn vector where the three translation elements are filled in

Definition at line 168 of file Pose.cpp.

void alvar::Pose::Invert ( )

Invert the pose

Examples:
SamplePointcloud.cpp.

Definition at line 132 of file Pose.cpp.

void alvar::Pose::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

Definition at line 141 of file Pose.cpp.

Pose & alvar::Pose::operator= ( const Pose p)

Assignment operator for copying Pose class

Definition at line 175 of file Pose.cpp.

void alvar::Pose::Output ( ) const

Output for debugging purposes

Definition at line 31 of file Pose.cpp.

void alvar::Pose::Reset ( )

Reset the pose

Examples:
SampleMarkerCreator.cpp, SampleMultiMarker.cpp, SampleMultiMarkerBundle.cpp, and SamplePointcloud.cpp.

Definition at line 69 of file Pose.cpp.

void alvar::Pose::SetMatrix ( const CvMat *  mat)

Set the transformation from the given matrix mat

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

Definition at line 75 of file Pose.cpp.

void alvar::Pose::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

Definition at line 113 of file Pose.cpp.

void alvar::Pose::SetTranslation ( const CvMat *  tra)

Set the translation part for the Pose

Parameters
traColumn vector containing three translation elements
Examples:
SampleMarkerCreator.cpp, SampleMultiMarker.cpp, and SamplePointcloud.cpp.

Definition at line 150 of file Pose.cpp.

void alvar::Pose::SetTranslation ( const double *  tra)

Set the translation part for the Pose

Parameters
traArray containing three translation elements

Definition at line 156 of file Pose.cpp.

void alvar::Pose::SetTranslation ( const double  x,
const double  y,
const double  z 
)

Set the translation part for the Pose

Definition at line 162 of file Pose.cpp.

void alvar::Pose::Transpose ( )

Transpose the transformation

Definition at line 123 of file Pose.cpp.

Member Data Documentation

double alvar::Pose::translation[4]

Definition at line 54 of file Pose.h.

CvMat alvar::Pose::translation_mat

Definition at line 55 of file Pose.h.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Jun 6 2019 19:27:24