argos::CQuaternion Class Reference

#include <quaternion.h>

Public Member Functions

 CQuaternion ()
 
 CQuaternion (const CQuaternion &c_quaternion)
 
 CQuaternion (Real f_real, Real f_img1, Real f_img2, Real f_img3)
 
 CQuaternion (const CRadians &c_radians, const CVector3 &c_vector3)
 
 CQuaternion (const CVector3 &c_vector1, const CVector3 &c_vector2)
 
Real GetW () const
 
Real GetX () const
 
Real GetY () const
 
Real GetZ () const
 
void SetW (Real f_w)
 
void SetX (Real f_x)
 
void SetY (Real f_y)
 
void SetZ (Real f_z)
 
void Set (Real f_w, Real f_x, Real f_y, Real f_z)
 
CQuaternion Conjugate () const
 
CQuaternion Inverse () const
 
Real Length () const
 
Real SquareLength () const
 
CQuaternionNormalize ()
 
CQuaternionFromAngleAxis (const CRadians &c_angle, const CVector3 &c_vector)
 
void ToAngleAxis (CRadians &c_angle, CVector3 &c_vector) const
 
CQuaternionFromEulerAngles (const CRadians &c_z_angle, const CRadians &c_y_angle, const CRadians &c_x_angle)
 
void ToEulerAngles (CRadians &c_z_angle, CRadians &c_y_angle, CRadians &c_x_angle) const
 
CQuaternionBetweenTwoVectors (const CVector3 &c_vector1, const CVector3 &c_vector2)
 
bool operator== (const CQuaternion &c_quaternion)
 
CQuaternionoperator= (const CQuaternion &c_quaternion)
 
CQuaternionoperator+= (const CQuaternion &c_quaternion)
 
CQuaternionoperator-= (const CQuaternion &c_quaternion)
 
CQuaternionoperator*= (const CQuaternion &c_quaternion)
 
CQuaternion operator+ (const CQuaternion &c_quaternion) const
 
CQuaternion operator- (const CQuaternion &c_quaternion) const
 
CQuaternion operator* (const CQuaternion &c_quaternion) const
 
 operator CRotationMatrix3 () const
 Implict conversion to rotation matrix. More...
 

Friends

std::ostream & operator<< (std::ostream &c_os, const CQuaternion &c_quaternion)
 Serializes the contents of the passed quaternion into a stream as Euler angles in the Z,Y,X format in degrees. More...
 
std::istream & operator>> (std::istream &c_is, CQuaternion &c_quaternion)
 Deserializes the contents of a stream and stores it into the passed quaternion. More...
 

Detailed Description

Definition at line 15 of file quaternion.h.

Constructor & Destructor Documentation

argos::CQuaternion::CQuaternion ( )
inline

Definition at line 18 of file quaternion.h.

argos::CQuaternion::CQuaternion ( const CQuaternion c_quaternion)
inline

Definition at line 25 of file quaternion.h.

argos::CQuaternion::CQuaternion ( Real  f_real,
Real  f_img1,
Real  f_img2,
Real  f_img3 
)
inline

Definition at line 29 of file quaternion.h.

argos::CQuaternion::CQuaternion ( const CRadians c_radians,
const CVector3 c_vector3 
)
inline

Definition at line 39 of file quaternion.h.

argos::CQuaternion::CQuaternion ( const CVector3 c_vector1,
const CVector3 c_vector2 
)
inline

Definition at line 44 of file quaternion.h.

Member Function Documentation

CQuaternion& argos::CQuaternion::BetweenTwoVectors ( const CVector3 c_vector1,
const CVector3 c_vector2 
)
inline

Definition at line 220 of file quaternion.h.

CQuaternion argos::CQuaternion::Conjugate ( ) const
inline

Definition at line 91 of file quaternion.h.

CQuaternion& argos::CQuaternion::FromAngleAxis ( const CRadians c_angle,
const CVector3 c_vector 
)
inline

Definition at line 126 of file quaternion.h.

CQuaternion& argos::CQuaternion::FromEulerAngles ( const CRadians c_z_angle,
const CRadians c_y_angle,
const CRadians c_x_angle 
)
inline

Definition at line 163 of file quaternion.h.

Real argos::CQuaternion::GetW ( ) const
inline

Definition at line 49 of file quaternion.h.

Real argos::CQuaternion::GetX ( ) const
inline

Definition at line 53 of file quaternion.h.

Real argos::CQuaternion::GetY ( ) const
inline

Definition at line 57 of file quaternion.h.

Real argos::CQuaternion::GetZ ( ) const
inline

Definition at line 61 of file quaternion.h.

CQuaternion argos::CQuaternion::Inverse ( ) const
inline

Definition at line 98 of file quaternion.h.

Real argos::CQuaternion::Length ( ) const
inline

Definition at line 105 of file quaternion.h.

CQuaternion& argos::CQuaternion::Normalize ( )
inline

Definition at line 117 of file quaternion.h.

argos::CQuaternion::operator CRotationMatrix3 ( ) const
inline

Implict conversion to rotation matrix.

This code is based on the solution used by Bullet

Definition at line 341 of file quaternion.h.

CQuaternion argos::CQuaternion::operator* ( const CQuaternion c_quaternion) const
inline

Definition at line 332 of file quaternion.h.

CQuaternion& argos::CQuaternion::operator*= ( const CQuaternion c_quaternion)
inline

Definition at line 295 of file quaternion.h.

CQuaternion argos::CQuaternion::operator+ ( const CQuaternion c_quaternion) const
inline

Definition at line 320 of file quaternion.h.

CQuaternion& argos::CQuaternion::operator+= ( const CQuaternion c_quaternion)
inline

Definition at line 279 of file quaternion.h.

CQuaternion argos::CQuaternion::operator- ( const CQuaternion c_quaternion) const
inline

Definition at line 326 of file quaternion.h.

CQuaternion& argos::CQuaternion::operator-= ( const CQuaternion c_quaternion)
inline

Definition at line 287 of file quaternion.h.

CQuaternion& argos::CQuaternion::operator= ( const CQuaternion c_quaternion)
inline

Definition at line 269 of file quaternion.h.

bool argos::CQuaternion::operator== ( const CQuaternion c_quaternion)
inline

Definition at line 262 of file quaternion.h.

void argos::CQuaternion::Set ( Real  f_w,
Real  f_x,
Real  f_y,
Real  f_z 
)
inline

Definition at line 81 of file quaternion.h.

void argos::CQuaternion::SetW ( Real  f_w)
inline

Definition at line 65 of file quaternion.h.

void argos::CQuaternion::SetX ( Real  f_x)
inline

Definition at line 69 of file quaternion.h.

void argos::CQuaternion::SetY ( Real  f_y)
inline

Definition at line 73 of file quaternion.h.

void argos::CQuaternion::SetZ ( Real  f_z)
inline

Definition at line 77 of file quaternion.h.

Real argos::CQuaternion::SquareLength ( ) const
inline

Definition at line 109 of file quaternion.h.

void argos::CQuaternion::ToAngleAxis ( CRadians c_angle,
CVector3 c_vector 
) const
inline

Definition at line 143 of file quaternion.h.

void argos::CQuaternion::ToEulerAngles ( CRadians c_z_angle,
CRadians c_y_angle,
CRadians c_x_angle 
) const
inline

Definition at line 172 of file quaternion.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  c_os,
const CQuaternion c_quaternion 
)
friend

Serializes the contents of the passed quaternion into a stream as Euler angles in the Z,Y,X format in degrees.

Parameters
c_osThe stream.
c_quaternionThe quaternion.
Returns
The new state of the stream.

Definition at line 360 of file quaternion.h.

std::istream& operator>> ( std::istream &  c_is,
CQuaternion c_quaternion 
)
friend

Deserializes the contents of a stream and stores it into the passed quaternion.

This method assumes Euler angles in Z,Y,X format and given in degrees.

Parameters
c_isThe stream.
c_quaternionThe quaternion.
Returns
The new state of the stream.

Definition at line 376 of file quaternion.h.