The RMP Motion Controller APIs
Quaternion

Quaternion for representing rotations. More...

Static Functions

static Quaternion FromAngleAxis (double angle, const Vector3d &axis)
 Creates a quaternion from an axis angle representation. More...
 
static Quaternion FromMatrix (const double *const mat)
 Matrix to Quaternion. More...
 

Attributes

Vector3d V
 Vector3d (imaginary) component of Quaternion. 1->x, 2->y, 3->z. Do not modify this unless you know what you are doing.
 
double W
 W (real component) of Quaternion. Do not modify this unless you know what you are doing.
 

Functions

 Quaternion ()
 Default Constructor. W=1, X=Y=Z=0.
 
 Quaternion (const Quaternion &rhs)
 Constructor. More...
 
 Quaternion (const Vector3d &rpy)
 Euler Constructor (Alternate) More...
 
 Quaternion (double w, const Vector3d &v)
 Constructor. More...
 
 Quaternion (double w, double x, double y, double z)
 Constructor. More...
 
 Quaternion (double x, double y, double z)
 Euler constructor. More...
 
Quaternion Conjugate () const
 Negates the imaginary component of the Quaternion. More...
 
double Dot (const Quaternion &rhs) const
 Returns the dot product of each element. w*rhs.w+v.dot(rhs.v) More...
 
bool Equals (const Quaternion &rhs, const double tolerance) const
 Equality check within tolerance. More...
 
Quaternion Inverse () const
 Conjugate scaled by 1 / SumSquares() More...
 
double Magnitude () const
 Gets the magnitude of this. sqrt(SumSquares()) More...
 
QuaternionNormalize ()
 Normalizes this. Scales each component by 1 / magnitude. More...
 
Quaternion Normalized () const
 Retunrs a normalized copy of this. More...
 
bool operator!= (const Quaternion &rhs) const
 Exact inequality check. See equals for approximately equal to. More...
 
Quaternion operator* (const Quaternion &rhs) const
 Multiplication (rotation) operator. Rotates other by this. More...
 
Vector3d operator* (const Vector3d &rhs) const
 Multiplication (vector rotation) operator. Rotates vector by this. More...
 
Quaternion operator* (double s) const
 Multiplication (scalar) operator. w*s, v*s. More...
 
Quaternionoperator*= (double s)
 Multiplication (scalar) assignment operator. See operator*(double) More...
 
Quaternion operator+ (const Quaternion &rhs) const
 Adds two quaternions together. this.w + rhs.w, this.v+rhs.v. More...
 
Quaternionoperator+= (const Quaternion &rhs)
 Addition assignment. Adds rhs into this. See operator+. More...
 
Quaternion operator- () const
 Negates this quaternion (w, and v) More...
 
Quaternion operator- (const Quaternion &rhs) const
 Subtraction operator. this.w - rhs.w, this.v-rhs.v. More...
 
Quaternionoperator-= (const Quaternion &rhs)
 Subtraction assignment. Subtracts other from this. See operator-. More...
 
Quaternionoperator= (const Quaternion &rhs)
 Assignment operator. Copies underlying. More...
 
bool operator== (const Quaternion &rhs) const
 Exact equality check. See equals for approximately equal to. More...
 
QuaternionSet (const Quaternion &rhs)
 Assigns other into this. More...
 
QuaternionSet (const Vector3d &vec)
 Assigns the quaternion defined by the Euler Angles into this. More...
 
QuaternionSet (double w, const Vector3d &vec)
 Assigns other into this. More...
 
QuaternionSet (double w, double x, double y, double z)
 Assigns each component into this. More...
 
QuaternionSet (double x, double y, double z)
 Assigns the quaternion defined by the Euler angles into this. If you get unexpected values, try negating the returned quaternion (change the direction of rotation) More...
 
double SumSquares () const
 Gets the sum of the components squared (w*w+this.dot(this)) More...
 
void ToAngleAxis (double &out_angle, Vector3d &out_axis) const
 Gets the axis angle representation of this quaternion. More...
 
Vector3d ToEuler () const
 Gets the Euler Angle representation of this quaternion. More...
 
void ToMatrix (double *mat) const
 Quaternion To Matrix. More...
 

Description

Definition at line 178 of file cartesianrobot.h.