octomap
1.9.7
|
This class represents a Quaternion. More...
Public Member Functions | |
Quaternion | inv () const |
Inversion. More... | |
Quaternion & | inv_IP () |
Inversion. More... | |
float | norm () const |
Quaternion & | normalize () |
Quaternion | normalized () const |
float & | operator() (unsigned int i) |
const float & | operator() (unsigned int i) const |
Quaternion | operator* (const Quaternion &other) const |
Quaternion multiplication. More... | |
Quaternion | operator* (const Vector3 &v) const |
Quaternion multiplication with extended vector. More... | |
void | operator/= (float x) |
Quaternion & | operator= (const Quaternion &other) |
bool | operator== (const Quaternion &other) const |
Quaternion () | |
Default constructor. More... | |
Quaternion (const Quaternion &other) | |
Copy constructor. More... | |
Quaternion (const Vector3 &axis, double angle) | |
Constructs a Unit Quaternion from a rotation angle and axis. More... | |
Quaternion (const Vector3 &other) | |
Constructor. More... | |
Quaternion (double roll, double pitch, double yaw) | |
Constructor from Euler angles. More... | |
Quaternion (float u, float x, float y, float z) | |
Constructor. More... | |
std::istream & | read (std::istream &s) |
std::istream & | readBinary (std::istream &s) |
Vector3 | rotate (const Vector3 &v) const |
Rotate a vector. More... | |
Vector3 | toEuler () const |
Conversion to Euler angles. More... | |
void | toRotMatrix (std::vector< double > &rot_matrix_3_3) const |
float & | u () |
const float & | u () const |
std::ostream & | write (std::ostream &s) const |
std::ostream & | writeBinary (std::ostream &s) const |
float & | x () |
const float & | x () const |
float & | y () |
const float & | y () const |
float & | z () |
const float & | z () const |
Protected Attributes | |
float | data [4] |
Friends | |
Quaternion | operator* (const Vector3 &v, const Quaternion &q) |
Quaternion multiplication with extended vector. More... | |
This class represents a Quaternion.
The Unit Quaternion is one possible representation of the attitude of an object in tree-dimensional space.
This Quaternion class is implemented according to Diebel, James. Representing Attitude: Euler Angle, Unit Quaternions, and Rotation Vectors. Stanford University. 2006. - Technical Report.
|
inline |
Default constructor.
Constructs the (1,0,0,0) Unit Quaternion representing the identity rotation.
References u(), x(), y(), and z().
Referenced by inv(), operator*(), and Quaternion().
octomath::Quaternion::Quaternion | ( | const Quaternion & | other | ) |
Copy constructor.
References data.
octomath::Quaternion::Quaternion | ( | float | u, |
float | x, | ||
float | y, | ||
float | z | ||
) |
octomath::Quaternion::Quaternion | ( | const Vector3 & | other | ) |
Constructor.
other | a vector containing euler angles |
References operator=(), octomath::Vector3::pitch(), Quaternion(), octomath::Vector3::roll(), and octomath::Vector3::yaw().
octomath::Quaternion::Quaternion | ( | double | roll, |
double | pitch, | ||
double | yaw | ||
) |
Constructor from Euler angles.
Constructs a Unit Quaternion from Euler angles / Tait Bryan angles (in radians) according to the 1-2-3 convention.
roll | phi/roll angle (rotation about x-axis) |
pitch | theta/pitch angle (rotation about y-axis) |
yaw | psi/yaw angle (rotation about z-axis) |
octomath::Quaternion::Quaternion | ( | const Vector3 & | axis, |
double | angle | ||
) |
Constructs a Unit Quaternion from a rotation angle and axis.
References u(), octomath::Vector3::x(), x(), octomath::Vector3::y(), y(), octomath::Vector3::z(), and z().
|
inline |
Inversion.
References Quaternion(), u(), x(), y(), and z().
Referenced by octomath::Pose6D::inv(), octomath::Pose6D::inv_IP(), and rotate().
Quaternion & octomath::Quaternion::inv_IP | ( | ) |
float octomath::Quaternion::norm | ( | ) | const |
References operator()().
Referenced by normalize(), toEuler(), and toRotMatrix().
Quaternion & octomath::Quaternion::normalize | ( | ) |
References norm().
Referenced by normalized().
Quaternion octomath::Quaternion::normalized | ( | ) | const |
References normalize().
Referenced by octomath::Pose6D::inv(), octomath::Pose6D::inv_IP(), and octomath::Pose6D::operator*().
|
inline |
References data.
|
inline |
References data.
Referenced by norm(), readBinary(), and writeBinary().
Quaternion octomath::Quaternion::operator* | ( | const Quaternion & | other | ) | const |
Quaternion multiplication.
Standard Quaternion multiplication which is not commutative.
References Quaternion(), u(), x(), y(), and z().
Quaternion octomath::Quaternion::operator* | ( | const Vector3 & | v | ) | const |
void octomath::Quaternion::operator/= | ( | float | x | ) |
References x().
Quaternion & octomath::Quaternion::operator= | ( | const Quaternion & | other | ) |
References u(), x(), y(), and z().
Referenced by Quaternion().
bool octomath::Quaternion::operator== | ( | const Quaternion & | other | ) | const |
std::istream & octomath::Quaternion::read | ( | std::istream & | s | ) |
Referenced by octomath::Pose6D::read().
std::istream & octomath::Quaternion::readBinary | ( | std::istream & | s | ) |
References operator()().
Referenced by octomath::Pose6D::readBinary().
Rotate a vector.
Rotates a vector to the body fixed coordinate system according to the attitude represented by this Quaternion.
v | a vector represented in world coordinates |
References inv(), x(), y(), and z().
Referenced by octomath::Pose6D::inv(), octomath::Pose6D::inv_IP(), octomath::Pose6D::operator*(), octomath::Pose6D::operator*=(), and octomath::Pose6D::transform().
Vector3 octomath::Quaternion::toEuler | ( | ) | const |
Conversion to Euler angles.
Converts the attitude represented by this to Euler angles (roll, pitch, yaw).
References norm(), u(), x(), y(), and z().
Referenced by octomath::Pose6D::pitch(), octomath::Pose6D::roll(), octomap::ScanNode::writePoseASCII(), and octomath::Pose6D::yaw().
void octomath::Quaternion::toRotMatrix | ( | std::vector< double > & | rot_matrix_3_3 | ) | const |
|
inline |
References data.
Referenced by inv(), operator*(), octomath::operator<<(), operator=(), Quaternion(), toEuler(), and toRotMatrix().
|
inline |
References data.
std::ostream & octomath::Quaternion::write | ( | std::ostream & | s | ) | const |
Referenced by octomath::Pose6D::write().
std::ostream & octomath::Quaternion::writeBinary | ( | std::ostream & | s | ) | const |
References operator()().
Referenced by octomath::Pose6D::writeBinary().
|
inline |
References data.
Referenced by inv(), inv_IP(), operator*(), operator/=(), octomath::operator<<(), operator=(), Quaternion(), rotate(), toEuler(), and toRotMatrix().
|
inline |
References data.
|
inline |
References data.
Referenced by inv(), inv_IP(), operator*(), octomath::operator<<(), operator=(), Quaternion(), rotate(), toEuler(), and toRotMatrix().
|
inline |
References data.
|
inline |
References data.
Referenced by inv(), inv_IP(), operator*(), octomath::operator<<(), operator=(), Quaternion(), rotate(), toEuler(), and toRotMatrix().
|
inline |
References data.
|
friend |
Quaternion multiplication with extended vector.
|
protected |
Referenced by operator()(), Quaternion(), u(), x(), y(), and z().