opensurgsim
|
Definitions of quaternion types. More...
#include <math.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
Go to the source code of this file.
Namespaces | |
SurgSim | |
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui needs glew but we need to call glewInit() from a osg callback, using this call we avoid getting warnings about redefinitions. | |
Typedefs | |
typedef Eigen::Quaternion< float > | SurgSim::Math::Quaternionf |
A quaternion of floats. More... | |
typedef Eigen::Quaternion< double > | SurgSim::Math::Quaterniond |
A quaternion of doubles. More... | |
Functions | |
template<typename T , int VOpt> | |
Eigen::Quaternion< T > | SurgSim::Math::makeRotationQuaternion (const T &angle, const Eigen::Matrix< T, 3, 1, VOpt > &axis) |
Create a quaternion rotation corresponding to the specified angle (in radians) and axis. More... | |
template<typename T , int QOpt> | |
Eigen::Quaternion< T, QOpt > | SurgSim::Math::negate (const Eigen::Quaternion< T, QOpt > &q) |
Quaternion negation (i.e. More... | |
template<typename T , int QOpt, int VOpt> | |
void | SurgSim::Math::computeAngleAndAxis (const Eigen::Quaternion< T, QOpt > &quaternion, T *angle, Eigen::Matrix< T, 3, 1, VOpt > *axis) |
Get the angle (in radians) and axis corresponding to a quaternion's rotation. More... | |
template<typename T , int QOpt> | |
T | SurgSim::Math::computeAngle (const Eigen::Quaternion< T, QOpt > &quaternion) |
Get the angle corresponding to a quaternion's rotation, in radians. More... | |
template<typename T , int TOpt, int VOpt> | |
void | SurgSim::Math::computeRotationVector (const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > &end, const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > &start, Eigen::Matrix< T, 3, 1, VOpt > *rotationVector) |
Get the vector corresponding to the rotation between transforms. More... | |
template<typename T , int QOpt> | |
Eigen::Quaternion< T, QOpt > | SurgSim::Math::interpolate (const Eigen::Quaternion< T, QOpt > &q0, const Eigen::Quaternion< T, QOpt > &q1, T t) |
Interpolate (slerp) between 2 quaternions. More... | |
template<typename T > | |
::std::ostream & | Eigen::operator<< (::std::ostream &os, const Eigen::Quaternion< T > &quaternion) |
Definitions of quaternion types.
typedef Eigen::Quaternion<double> SurgSim::Math::Quaterniond |
A quaternion of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Quaternion<float> SurgSim::Math::Quaternionf |
A quaternion of floats.
This type (and any structs that contain it) can be safely allocated via new.
|
inline |
Get the angle corresponding to a quaternion's rotation, in radians.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion argument. Can be deduced. |
quaternion | the rotation quaternion to inspect. |
|
inline |
Get the angle (in radians) and axis corresponding to a quaternion's rotation.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion argument. Can be deduced. |
VOpt | the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
quaternion | the rotation quaternion to inspect. | |
[out] | angle | the angle of the rotation in [0 +pi], in radians. |
[out] | axis | the axis of the rotation. |
void SurgSim::Math::computeRotationVector | ( | const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > & | end, |
const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > & | start, | ||
Eigen::Matrix< T, 3, 1, VOpt > * | rotationVector | ||
) |
Get the vector corresponding to the rotation between transforms.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
TOpt | the option flags (alignment etc.) used for the transform arguments. Can be deduced. |
VOpt | the option flags (alignment etc.) used for the vector argument. Can be deduced. |
end | the transform after the rotation. | |
start | the transform before the rotation. | |
[out] | rotationVector | a vector describing the rotation. |
|
inline |
Interpolate (slerp) between 2 quaternions.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion arguments. Can be deduced. |
q0 | The start quaternion (at time 0.0). |
q1 | The end quaternion (at time 1.0). |
t | The interpolation time requested. Within [0..1]. |
|
inline |
Create a quaternion rotation corresponding to the specified angle (in radians) and axis.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
VOpt | the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
angle | the angle of the rotation, in radians. |
axis | the axis of the rotation. |
|
inline |
Quaternion negation (i.e.
unary operator -)
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion arguments. Can be deduced. |
q | The quaternion to negate |