Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
alvar::Rotation Class Reference

Rotation structure and transformations between different parameterizations. More...

#include <Rotation.h>

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

List of all members.

Public Types

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...

Public Member Functions

void GetEuler (CvMat *mat) const
 Returns the rotation in Euler angles.
void GetMatrix (CvMat *mat) const
 Returns the rotation in matrix form. 3x3 and 4x4 matrices are allowed.
void GetQuaternion (CvMat *mat) const
 Returns the rotation in quaternion form.
void GetRodriques (CvMat *mat) const
 Returns the rotation in rotation vector form.
void Mirror (bool x, bool y, bool z)
 Mirrors the rotation in selected directions.
Rotationoperator+= (const Rotation &v)
Rotationoperator= (const Rotation &p)
void Reset ()
 Resets the rotation into identity.
 Rotation ()
 Rotation (const Rotation &r)
 Rotation (CvMat *data, RotationType t)
 Constructor.
void SetEuler (const CvMat *mat)
 Sets the rotation from given Euler angles.
void SetMatrix (const CvMat *mat)
 Sets the rotation from given rotation matrix. 3x3 and 4x4 matrices are allowed.
void SetQuaternion (CvMat *mat)
 Sets the rotation from given quaternion.
void SetQuaternion (const double *quat)
 Sets the rotation from given quaternion.
void SetRodriques (const CvMat *mat)
 Sets the rotation from given rotation vector.
void Transpose ()

Static Public Member Functions

static void EulToQuat (const double *eul, double *quat)
 Converts a rotation described by Euler angles into quaternion form.
static void Mat9ToQuat (const double *mat, double *quat)
 Converts a 3x3 rotation martix into quaternion form.
static void Mat9ToRod (double *mat, double *rod)
 Converts 3x3 rotation matrix into Rodriques representation.
static void MirrorMat (CvMat *mat, bool x, bool y, bool z)
 Simple function to mirror a rotation matrix in different directions.
static void QuatInv (const double *q, double *qi)
 Inverts unit quaternion.
static void QuatMul (const double *q1, const double *q2, double *q3)
 Quaternion multiplication.
static void QuatNorm (double *q)
 Normalizes a quaternion.
static void QuatToEul (const double *q, double *eul)
 Converts a rotation described by a quaternion into Euler angles.
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.
static void QuatToMat9 (const double *quat, double *mat)
 Converts a rotation described by a quaternion into 3x3 rotation matrix.
static void RodToMat9 (double *rod, double *mat)
 Converts 3x1 rotation vector into 3x3 rotation matrix using Rodriques' formula.

Public Attributes

double quaternion [4]
CvMat quaternion_mat

Detailed Description

Rotation structure and transformations between different parameterizations.

Definition at line 43 of file Rotation.h.


Member Enumeration Documentation

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.


Constructor & Destructor Documentation

Definition at line 32 of file Rotation.cpp.

Definition at line 38 of file Rotation.cpp.

alvar::Rotation::Rotation ( CvMat *  data,
RotationType  t 
)

Constructor.

Parameters:
dataRotation data stored in CvMat. With RotationType::MAT both 3x3 and 4x4 matrices are allowed.
tRotation type that corresponds to data.

Definition at line 43 of file Rotation.cpp.


Member Function Documentation

void alvar::Rotation::EulToQuat ( const double *  eul,
double *  quat 
) [static]

Converts a rotation described by Euler angles into quaternion form.

Parameters:
eulRotation in Euler angles.
quatResulting quaternion.

Definition at line 271 of file Rotation.cpp.

void alvar::Rotation::GetEuler ( CvMat *  mat) const

Returns the rotation in Euler angles.

Parameters:
matThe 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:
matThe rotation is stored here.

Reimplemented in alvar::Pose.

Definition at line 331 of file Rotation.cpp.

void alvar::Rotation::GetQuaternion ( CvMat *  mat) const

Returns the rotation in quaternion form.

Parameters:
matThe 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:
matThe 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:
mat3x3 rotation matrix.
quatResulting 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:
mat3x3 rotation matrix.
rodResulting 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:
x
y
z

Reimplemented in alvar::Pose.

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:
matMatrix to be mirrored.
x
y
z

Definition at line 75 of file Rotation.cpp.

Rotation & alvar::Rotation::operator+= ( const Rotation v) [inline]

Definition at line 365 of file Rotation.cpp.

Rotation & alvar::Rotation::operator= ( const Rotation p) [inline]

Definition at line 359 of file Rotation.cpp.

void alvar::Rotation::QuatInv ( const double *  q,
double *  qi 
) [static]

Inverts unit quaternion.

Parameters:
qUnit quaternion to be inverted.
qiResulting 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
q3Resulting quaternion.

Definition at line 132 of file Rotation.cpp.

void alvar::Rotation::QuatNorm ( double *  q) [static]

Normalizes a quaternion.

Parameters:
qQuaternion 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:
qRotation in quaternion form.
eulResulting 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:
quatRotation in quaternion form.
matResulting 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:
quatRotation in quaternion form.
matCorresponding 3x3 rotation matrix.

Definition at line 152 of file Rotation.cpp.

Resets the rotation into identity.

Reimplemented in alvar::Pose.

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:
rod3x1 rotation vector.
Resulting3x3 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:
matInput 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:
matInput rotation matrix (3x3 or 4x4 CvMat).

Reimplemented in alvar::Pose.

Definition at line 321 of file Rotation.cpp.

void alvar::Rotation::SetQuaternion ( CvMat *  mat)

Sets the rotation from given quaternion.

Parameters:
matInput 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:
matInput 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:
matInput rotation vector (3x1 CvMat).

Definition at line 314 of file Rotation.cpp.

Reimplemented in alvar::Pose.

Definition at line 66 of file Rotation.cpp.


Member Data Documentation

Definition at line 48 of file Rotation.h.

Definition at line 47 of file Rotation.h.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Sun Oct 5 2014 22:16:27