opensurgsim
|
Tests that exercise the functionality of our quaternion typedefs, which come straight from Eigen. More...
#include <math.h>
#include "SurgSim/Math/Quaternion.h"
#include "SurgSim/Math/MathConvert.h"
#include "gtest/gtest.h"
Classes | |
class | QuaternionTests< T > |
class | UnalignedQuaternionTests< T > |
Typedefs | |
typedef ::testing::Types< SurgSim::Math::Quaterniond, SurgSim::Math::Quaternionf > | QuaternionVariants |
typedef ::testing::Types< SurgSim::Math::Quaterniond, SurgSim::Math::Quaternionf > | UnalignedQuaternionVariants |
Functions | |
TYPED_TEST_CASE (QuaternionTests, QuaternionVariants) | |
TYPED_TEST_CASE (UnalignedQuaternionTests, UnalignedQuaternionVariants) | |
TYPED_TEST (QuaternionTests, CanConstruct) | |
Test that quaternions can be constructed. | |
TYPED_TEST (QuaternionTests, ConstructorInitialization) | |
Test that the constructor properly initializes quaternions in the WXYZ order. | |
TYPED_TEST (QuaternionTests, InitializeFromVector4) | |
Test setting the quaternion from a 4D vector. More... | |
TYPED_TEST (QuaternionTests, InitializeFromArray) | |
Test initializing from a float array. More... | |
TYPED_TEST (QuaternionTests, IdentityValue) | |
Test getting an identity value usable in expressions. | |
TYPED_TEST (QuaternionTests, SetToIdentity) | |
Test setting quaternions to identity. | |
TYPED_TEST (QuaternionTests, ZeroValue) | |
Test getting a zero value usable in expressions. More... | |
TYPED_TEST (QuaternionTests, SetToZero) | |
Test setting quaternions to zero. More... | |
TYPED_TEST (QuaternionTests, YamlConvert) | |
TYPED_TEST (QuaternionTests, FromAngleAxis) | |
Test setting quaternions from an angle/axis rotation. | |
template<class T > | |
void | testAngleAxis (const Eigen::Quaternion< T > &q, const Eigen::AngleAxis< T > &expectedAA, bool expectNegatedQuatOppositeAxis=false) |
TYPED_TEST (QuaternionTests, ToAngleAxis) | |
Test extracting an angle/axis rotation from a quaternion. | |
TYPED_TEST (QuaternionTests, FromMatrix) | |
Test setting a quaternion from a matrix. | |
TYPED_TEST (QuaternionTests, ToMatrix) | |
Test setting a matrix from a quaternion. | |
TYPED_TEST (QuaternionTests, Conjugate) | |
Test quaternion conjugate. | |
TYPED_TEST (QuaternionTests, Inverse) | |
Test quaternion inverse. | |
TYPED_TEST (QuaternionTests, ApplyToVector) | |
Test quaternion rotation of vectors. | |
TYPED_TEST (QuaternionTests, NormAndSquared) | |
Quaternion norm and its square. | |
TYPED_TEST (QuaternionTests, Normalize) | |
Normalization of quaternions. | |
TYPED_TEST (QuaternionTests, TypeCasting) | |
Typecasting quaternions (double <-> float conversions). | |
TYPED_TEST (QuaternionTests, ArrayReadWrite) | |
Reading from and writing to arrays or blocks of double/float in memory. | |
TYPED_TEST (QuaternionTests, Negate) | |
Test quaternion negation. | |
TYPED_TEST (QuaternionTests, SlerpInterpolation) | |
Test quaternion interpolation. | |
Tests that exercise the functionality of our quaternion typedefs, which come straight from Eigen.
TYPED_TEST | ( | QuaternionTests | , |
InitializeFromVector4 | |||
) |
Test setting the quaternion from a 4D vector.
The order of components is XYZW (not WXYZ), which is why doing this may be confusing.
TYPED_TEST | ( | QuaternionTests | , |
InitializeFromArray | |||
) |
Test initializing from a float array.
The order of components is XYZW (not WXYZ), which is why doing this may be confusing.
TYPED_TEST | ( | QuaternionTests | , |
ZeroValue | |||
) |
Test getting a zero value usable in expressions.
Note: many "4D" operations are not defined on Eigen::Quaternion, but can be performed on quaternion.coeffs().
TYPED_TEST | ( | QuaternionTests | , |
SetToZero | |||
) |
Test setting quaternions to zero.
Note: many "4D" operations are not defined on Eigen::Quaternion, but can be performed on quaternion.coeffs().