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.
 
static Quaternion FromMatrix (const double *const matrix)
 Matrix to Quaternion.
 

Functions

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

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.
 

Description

Examples
PathMotion.cs.

Definition at line 353 of file cartesianrobot.h.