rpos::core::Quaternion Class

This is struct that represents an orientation in quaternion form.

Header File

rpos/core/pose.h

Constructors

/**
* Create a new unit quaternion.
*/
Quaternion();
/**
* Create a new object with the specified x,y,z,w value.
*/
Quaternion(double x, double y, double z, double w);
/**
* Copy constructor.
*/
Quaternion(const Quaternion&);

Operators

/**
* Assignement operator.
*/
Quaternion& operator=(const Quaternion&);

Methods

/**
* Convert quatertion to eulerAngle in XYZ right-hand axis.
*/ 
rpos::core::Vector3f convertToEulerAngle();
/**
* Getter and setter for the x,y,z and w field.
*/
double x() const; 
double& x(); 
double y() const; 
double& y(); 
double z() const; 
double& z(); 
double w() const; 
double& w();

Example

Quaternion quaternion;
std::cout<<quaternion.x()<<std::endl;  // output 0
location.x() = 10;
std::cout<<quaternion.x()<<std::endl;  // output 10