11 #include <Eigen/Geometry> 16 template<
typename Scalar>
23 Matrix3
m(AngleAxisx(ea[0], Vector3::Unit(i)) * AngleAxisx(ea[1], Vector3::Unit(j)) * AngleAxisx(ea[2], Vector3::Unit(k)));
24 Vector3 eabis = m.eulerAngles(i, j, k);
25 Matrix3 mbis(AngleAxisx(eabis[0], Vector3::Unit(i)) * AngleAxisx(eabis[1], Vector3::Unit(j)) * AngleAxisx(eabis[2], Vector3::Unit(k)));
30 VERIFY((ea-eabis).norm() <= test_precision<Scalar>());
69 q1 = AngleAxisx(a, Vector3::Random().normalized());
73 Vector3 ea = m.eulerAngles(0,1,2);
75 ea = m.eulerAngles(0,1,0);
79 q1.coeffs() = Quaternionx::Coefficients::Random().normalized();
81 ea = m.eulerAngles(0,1,2);
83 ea = m.eulerAngles(0,1,0);
87 ea = (Array3::Random() + Array3(1,0,0))*
Scalar(
EIGEN_PI)*Array3(0.5,1,1);
void verify_euler(const Matrix< Scalar, 3, 1 > &ea, int i, int j, int k)
bool test_isMuchSmallerThan(const AnnoyingScalar &a, const AnnoyingScalar &b)
#define VERIFY_IS_APPROX(a, b)
#define CALL_SUBTEST_1(FUNC)
The quaternion class used to represent 3D orientations and rotations.
General-purpose arrays with easy API for coefficient-wise operations.
#define VERIFY_IS_APPROX_OR_LESS_THAN(a, b)
void check_all_var(const Matrix< Scalar, 3, 1 > &ea)
#define CALL_SUBTEST_2(FUNC)
EIGEN_DECLARE_TEST(geo_eulerangles)
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.