ViSP
2.10.0
|
#include <vpQuaternionVector.h>
Public Member Functions | |
vpQuaternionVector () | |
vpQuaternionVector (const vpQuaternionVector &q) | |
vpQuaternionVector (const double x, const double y, const double z, const double w) | |
vpQuaternionVector (const vpRotationMatrix &R) | |
void | buildFrom (const vpRotationMatrix &R) |
void | set (const double x, const double y, const double z, const double w) |
double | x () const |
double | y () const |
double | z () const |
double | w () const |
vpQuaternionVector | operator+ (vpQuaternionVector &q) |
vpQuaternionVector | operator- (vpQuaternionVector &q) |
vpQuaternionVector | operator- () |
vpQuaternionVector | operator* (const double l) |
vpQuaternionVector | operator* (vpQuaternionVector &rq) |
double & | operator[] (unsigned int n) |
const double & | operator[] (unsigned int n) const |
unsigned int | size () const |
vpRowVector | t () const |
Protected Member Functions | |
void | init (const unsigned int size) |
Protected Attributes | |
double * | r |
unsigned int | _size |
Defines a quaternion and its basic operations.
A quaternion is defined by four values: .
This class allows to compute a quaternion from a rotation matrix using either vpQuaternionVector(const vpRotationMatrix &) constructor or buildFrom() method.
It also defines common operations on a quaternion such as:
Definition at line 79 of file vpQuaternionVector.h.
|
inline |
Default constructor that initialize all the angles to zero.
Definition at line 86 of file vpQuaternionVector.h.
Referenced by operator*(), operator+(), and operator-().
|
inline |
Copy constructor.
Definition at line 88 of file vpQuaternionVector.h.
vpQuaternionVector::vpQuaternionVector | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | w | ||
) |
Constructor from doubles.
Definition at line 59 of file vpQuaternionVector.cpp.
vpQuaternionVector::vpQuaternionVector | ( | const vpRotationMatrix & | R | ) |
Constructs a quaternion from a rotation matrix.
R | : Matrix containing a rotation. |
Definition at line 71 of file vpQuaternionVector.cpp.
References buildFrom().
void vpQuaternionVector::buildFrom | ( | const vpRotationMatrix & | R | ) |
Constructs a quaternion from a rotation matrix.
R | : Rotation matrix. |
Definition at line 142 of file vpQuaternionVector.cpp.
References vpThetaUVector::extract(), and set().
Referenced by vpHomogeneousMatrix::extract(), and vpQuaternionVector().
|
protectedinherited |
Definition at line 117 of file vpRotationVector.cpp.
References vpRotationVector::_size, and vpRotationVector::r.
vpQuaternionVector vpQuaternionVector::operator* | ( | const double | l | ) |
Multiplication by scalar. Returns a quaternion defined by (lx,ly,lz,lw).
Definition at line 124 of file vpQuaternionVector.cpp.
References vpQuaternionVector(), w(), x(), y(), and z().
vpQuaternionVector vpQuaternionVector::operator* | ( | vpQuaternionVector & | rq | ) |
Multiply two quaternions.
Definition at line 130 of file vpQuaternionVector.cpp.
References vpQuaternionVector(), w(), x(), y(), and z().
vpQuaternionVector vpQuaternionVector::operator+ | ( | vpQuaternionVector & | q | ) |
Quaternion addition.
Adds two quaternions. Addition is component-wise.
q | : quaternion to add. |
Definition at line 101 of file vpQuaternionVector.cpp.
References vpQuaternionVector(), w(), x(), y(), and z().
vpQuaternionVector vpQuaternionVector::operator- | ( | vpQuaternionVector & | q | ) |
Quaternion substraction.
Substracts a quaternion from another. Substraction is component-wise.
q | : quaternion to substract. |
Definition at line 112 of file vpQuaternionVector.cpp.
References vpQuaternionVector(), w(), x(), y(), and z().
vpQuaternionVector vpQuaternionVector::operator- | ( | void | ) |
Negate operator. Returns a quaternion defined by (-x,-y,-z-,-w).
Definition at line 118 of file vpQuaternionVector.cpp.
References vpQuaternionVector(), w(), x(), y(), and z().
|
inlineinherited |
Operator that allows to set the value of an element of the rotation vector: r[i] = value
Definition at line 130 of file vpRotationVector.h.
|
inlineinherited |
Operator that allows to get the value of an element of the rotation vector: value = r[i]
Definition at line 135 of file vpRotationVector.h.
void vpQuaternionVector::set | ( | const double | x_, |
const double | y_, | ||
const double | z_, | ||
const double | w_ | ||
) |
Manually change values of a quaternion.
x_ | : x quaternion parameter. |
y_ | : y quaternion parameter. |
z_ | : z quaternion parameter. |
w_ | : w quaternion parameter. |
Definition at line 84 of file vpQuaternionVector.cpp.
References vpRotationVector::r.
Referenced by buildFrom().
|
inherited |
Returns the size of the rotation vector
Size of the rotation vector: number of double values describing the rotation. Common sizes are 4 for a quaternion and 3 for angle-based rotation vectors.
Definition at line 71 of file vpRotationVector.cpp.
References vpRotationVector::_size.
Referenced by vpRotationVector::operator=().
|
inherited |
Return the transpose of the rotation vector.
Definition at line 57 of file vpRotationVector.cpp.
References vpRotationVector::_size, and vpRotationVector::r.
|
inline |
Returns w-component of the quaternion.
Definition at line 103 of file vpQuaternionVector.h.
Referenced by vpRotationMatrix::buildFrom(), operator*(), operator+(), and operator-().
|
inline |
Returns x-component of the quaternion.
Definition at line 97 of file vpQuaternionVector.h.
Referenced by vpRotationMatrix::buildFrom(), operator*(), operator+(), and operator-().
|
inline |
Returns y-component of the quaternion.
Definition at line 99 of file vpQuaternionVector.h.
Referenced by vpRotationMatrix::buildFrom(), operator*(), operator+(), and operator-().
|
inline |
Returns z-component of the quaternion.
Definition at line 101 of file vpQuaternionVector.h.
Referenced by vpRotationMatrix::buildFrom(), operator*(), operator+(), and operator-().
|
protectedinherited |
Definition at line 99 of file vpRotationVector.h.
Referenced by vpRotationVector::init(), vpRotationVector::size(), vpRotationVector::t(), and vpColVector::vpColVector().
|
protectedinherited |
Definition at line 98 of file vpRotationVector.h.
Referenced by vpThetaUVector::buildFrom(), vpRzyzVector::buildFrom(), vpRzyxVector::buildFrom(), vpRxyzVector::buildFrom(), vpThetaUVector::extract(), vpRotationVector::init(), vpRotationVector::operator=(), vpThetaUVector::operator=(), vpRzyzVector::operator=(), set(), vpRotationVector::t(), vpColVector::vpColVector(), vpRxyzVector::vpRxyzVector(), vpRzyxVector::vpRzyxVector(), vpRzyzVector::vpRzyzVector(), and vpRotationVector::~vpRotationVector().