Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
alvar::Rotation Class Reference

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

#include <Rotation.h>

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

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

Static Public Member Functions

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

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

alvar::Rotation::Rotation ( )

Definition at line 32 of file Rotation.cpp.

alvar::Rotation::Rotation ( const Rotation r)

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.

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

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.

void alvar::Rotation::Reset ( )

Resets the rotation into identity.

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

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.

void alvar::Rotation::Transpose ( )

Definition at line 66 of file Rotation.cpp.

Member Data Documentation

double alvar::Rotation::quaternion[4]

Definition at line 48 of file Rotation.h.

CvMat alvar::Rotation::quaternion_mat

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 Mon Jun 10 2019 12:47:05