A quaternion class. More...
#include <Types.hh>
Public Member Functions | |
Quaternion () | |
Default Constructor. More... | |
Quaternion (const Quaternion &_q) | |
Copy constructor. More... | |
Quaternion (const double &_roll, const double &_pitch, const double &_yaw) | |
Quaternion (double _w, double _x, double _y, double _z) | |
Constructor. More... | |
void | Correct () |
Vector3 | GetAsEuler () const |
Return the rotation in Euler angles. More... | |
Quaternion | GetInverse () const |
Get the inverse of this quaternion. More... | |
void | Normalize () |
Normalize the quaternion. More... | |
Quaternion | operator* (const Quaternion &_q) const |
Multiplication operator. More... | |
Vector3 | operator* (const Vector3 &_v) const |
Vector3 multiplication operator. More... | |
Quaternion & | operator= (const Quaternion &_qt) |
Equal operator. More... | |
bool | operator== (const Quaternion &_qt) const |
Equal to operator. More... | |
Vector3 | RotateVector (const Vector3 &_vec) const |
Rotate a vector using the quaternion. More... | |
void | SetFromEuler (const Vector3 &_vec) |
Set the quaternion from Euler angles. More... | |
Static Public Member Functions | |
static Quaternion | EulerToQuaternion (double _x, double _y, double _z) |
Convert euler angles to quatern. More... | |
static Quaternion | EulerToQuaternion (const Vector3 &_vec) |
Convert euler angles to quatern. More... | |
Public Attributes | |
double | w |
w data More... | |
double | x |
x data More... | |
double | y |
y data More... | |
double | z |
z data More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const Quaternion &_q) |
Stream insertion operator. More... | |
std::istream & | operator>> (std::istream &_in, Quaternion &_q) |
Stream extraction operator. More... | |
A quaternion class.
|
inline |
Default Constructor.
Referenced by operator*().
|
inline |
Copy constructor.
[in] | _q | Quaternion to copy |
|
inline |
References SetFromEuler().
|
inline |
Constructor.
[in] | _w | W param |
[in] | _x | X param |
[in] | _y | Y param |
[in] | _z | Z param |
|
inline |
References sdf::equal(), w, x, y, and z.
Referenced by sdf::Pose::Pose().
|
inlinestatic |
Convert euler angles to quatern.
[in] | _x | rotation along x |
[in] | _y | rotation along y |
[in] | _z | rotation along z |
|
inlinestatic |
Convert euler angles to quatern.
[in] | _vec | Vector of Euler angles |
References SetFromEuler().
|
inline |
Return the rotation in Euler angles.
References Normalize(), w, sdf::Vector3::x, x, sdf::Vector3::y, y, sdf::Vector3::z, and z.
Referenced by operator==().
|
inline |
Get the inverse of this quaternion.
References sdf::equal(), w, x, y, and z.
Referenced by sdf::Pose::CoordPositionAdd(), and RotateVector().
|
inline |
Normalize the quaternion.
References sdf::equal(), w, x, y, and z.
Referenced by GetAsEuler(), and SetFromEuler().
|
inline |
Multiplication operator.
[in] | _qt | Quaternion for multiplication |
References Quaternion(), w, x, y, and z.
|
inline |
|
inline |
Equal to operator.
[in] | _qt | Quaternion for comparison |
References GetAsEuler().
Rotate a vector using the quaternion.
[in] | _vec | vector to rotate |
References GetInverse(), sdf::Vector3::x, x, sdf::Vector3::y, y, sdf::Vector3::z, and z.
|
inline |
Set the quaternion from Euler angles.
[in] | _vec | Euler angle |
References Normalize(), w, sdf::Vector3::x, x, sdf::Vector3::y, y, sdf::Vector3::z, and z.
Referenced by EulerToQuaternion(), and Quaternion().
|
friend |
Stream insertion operator.
[in] | _out | output stream |
[in] | _q | quaternion to output |
|
friend |
Stream extraction operator.
[in] | _in | input stream |
[in] | _q | Quaternion to read values into |
double sdf::Quaternion::w |
w data
Referenced by sdf::Pose::CoordPositionAdd(), Correct(), GetAsEuler(), GetInverse(), Normalize(), operator*(), operator=(), and SetFromEuler().
double sdf::Quaternion::x |
x data
Referenced by sdf::Pose::CoordPositionAdd(), Correct(), GetAsEuler(), GetInverse(), Normalize(), operator*(), operator=(), RotateVector(), and SetFromEuler().
double sdf::Quaternion::y |
y data
Referenced by sdf::Pose::CoordPositionAdd(), Correct(), GetAsEuler(), GetInverse(), Normalize(), operator*(), operator=(), RotateVector(), and SetFromEuler().
double sdf::Quaternion::z |
z data
Referenced by sdf::Pose::CoordPositionAdd(), Correct(), GetAsEuler(), GetInverse(), Normalize(), operator*(), operator=(), RotateVector(), and SetFromEuler().