quaternion.cpp File Reference
Detailed Description
Quaternion functions.
Definition in file quaternion.cpp.
#include "quaternion.h"
Include dependency graph for quaternion.cpp:
Go to the source code of this file.
|
Namespaces |
namespace | ROBOOP |
Functions |
ReturnMatrix | Omega (const Quaternion &q, const Quaternion &q_dot) |
| Return angular velocity from a quaternion and it's time derivative.
|
short | Integ_quat (Quaternion &dquat_present, Quaternion &dquat_past, Quaternion &quat, const Real dt) |
| Trapezoidal quaternion integration.
|
Real | Integ_Trap_quat_s (const Quaternion &present, Quaternion &past, const Real dt) |
| Trapezoidal quaternion scalar part integration.
|
ReturnMatrix | Integ_Trap_quat_v (const Quaternion &present, Quaternion &past, const Real dt) |
| Trapezoidal quaternion vector part integration.
|
Quaternion | Slerp (const Quaternion &q0, const Quaternion &q1, const Real t) |
| Spherical Linear Interpolation.
|
Quaternion | Slerp_prime (const Quaternion &q0, const Quaternion &q1, const Real t) |
| Spherical Linear Interpolation derivative.
|
Quaternion | Squad (const Quaternion &p, const Quaternion &a, const Quaternion &b, const Quaternion &q, const Real t) |
| Spherical Cubic Interpolation.
|
Quaternion | Squad_prime (const Quaternion &p, const Quaternion &a, const Quaternion &b, const Quaternion &q, const Real t) |
| Spherical Cubic Interpolation derivative.
|
Variables |
const char | rcsid [] = "$Id: quaternion.cpp,v 1.4 2004/07/14 02:32:12 ejt Exp $" |
| RCS/CVS version.
|
Function Documentation
short ROBOOP::Integ_quat |
( |
Quaternion & |
dquat_present, |
|
|
Quaternion & |
dquat_past, |
|
|
Quaternion & |
quat, |
|
|
const Real |
dt |
|
) |
|
|
Real ROBOOP::Integ_Trap_quat_s |
( |
const Quaternion & |
present, |
|
|
Quaternion & |
past, |
|
|
const Real |
dt |
|
) |
|
|
ReturnMatrix ROBOOP::Integ_Trap_quat_v |
( |
const Quaternion & |
present, |
|
|
Quaternion & |
past, |
|
|
const Real |
dt |
|
) |
|
|
ReturnMatrix ROBOOP::Omega |
( |
const Quaternion & |
q, |
|
|
const Quaternion & |
q_dot |
|
) |
|
|
Quaternion ROBOOP::Slerp |
( |
const Quaternion & |
q0, |
|
|
const Quaternion & |
q1, |
|
|
const Real |
t |
|
) |
|
|
Quaternion ROBOOP::Slerp_prime |
( |
const Quaternion & |
q0, |
|
|
const Quaternion & |
q1, |
|
|
const Real |
t |
|
) |
|
|
|
Spherical Linear Interpolation derivative.
Cite_: Dam
The derivative of the function where is a constant unit quaternion is
Using the preceding equation the Slerp derivative is then
It is customary to choose the sign G on q1 so that q0.Gq1 >=0 (the angle between q0 ang Gq1 is acute). This choice avoids extra spinning caused by the interpolated rotations. The result is not necessary a unit quaternion.
Definition at line 690 of file quaternion.cpp.
Referenced by ROBOOP::Spl_Quaternion::quat_w(). |
Quaternion ROBOOP::Squad |
( |
const Quaternion & |
p, |
|
|
const Quaternion & |
a, |
|
|
const Quaternion & |
b, |
|
|
const Quaternion & |
q, |
|
|
const Real |
t |
|
) |
|
|
|
Spherical Cubic Interpolation.
Cite_: Dam
Let four quaternions be (p), (a), (b) and (q) be the ordered vertices of a quadrilateral. Obtain c from to interpolation. Obtain d from to interpolation. Obtain e, the final result, from c to d interpolation.
The intermediate quaternion and are given by
Definition at line 723 of file quaternion.cpp.
Referenced by ROBOOP::Spl_Quaternion::quat(), and ROBOOP::Spl_Quaternion::quat_w(). |
Quaternion ROBOOP::Squad_prime |
( |
const Quaternion & |
p, |
|
|
const Quaternion & |
a, |
|
|
const Quaternion & |
b, |
|
|
const Quaternion & |
q, |
|
|
const Real |
t |
|
) |
|
|
|
Spherical Cubic Interpolation derivative.
Cite_: www.magic-software.com
The derivative of the function where is a constant unit quaternion is
Recalling that (see Quaternion::Log()). If the power is a function we have
If is a function of time and the power is differentiable function of time we have
Using these last three equations Squad derivative can be define. Let , , . We then have 
where , , 
The result is not necessarily a unit quaternion even if all the input quaternions are unit.
Definition at line 749 of file quaternion.cpp.
Referenced by ROBOOP::Spl_Quaternion::quat_w(). |
Variable Documentation
const char rcsid[] = "$Id: quaternion.cpp,v 1.4 2004/07/14 02:32:12 ejt Exp $" [static] |
|
|