12 #include <unsupported/Eigen/EulerAngles>
14 using namespace Eigen;
17 template <
typename Scalar,
class System>
24 #define VERIFY_APPROXED_RANGE(a, x, b) \
26 VERIFY_IS_APPROX_OR_LESS_THAN(a, x); \
27 VERIFY_IS_APPROX_OR_LESS_THAN(x, b); \
34 template<
typename Scalar,
class EulerSystem>
55 Scalar betaRangeStart, betaRangeEnd;
58 betaRangeStart = -HALF_PI;
59 betaRangeEnd = HALF_PI;
75 const Vector3 I_ = EulerAnglesType::AlphaAxisVector();
76 const Vector3 J_ = EulerAnglesType::BetaAxisVector();
77 const Vector3 K_ = EulerAnglesType::GammaAxisVector();
87 EulerAnglesType ebis(
m);
100 const Matrix3 mbis(AngleAxisType(ebis.alpha(), I_) * AngleAxisType(ebis.beta(), J_) * AngleAxisType(ebis.gamma(), K_));
125 const QuaternionType
q(
e);
127 const QuaternionType qbis(ebis);
137 template<
signed char A,
signed char B,
signed char C,
typename Scalar>
143 template<
signed char A,
signed char B,
signed char C,
typename Scalar>
146 verify_euler_vec<+A,+B,+C>(ea);
159 verify_euler_all_neg<X,Y,Z>(ea);
160 verify_euler_all_neg<X,Y,X>(ea);
161 verify_euler_all_neg<X,Z,Y>(ea);
162 verify_euler_all_neg<X,Z,X>(ea);
164 verify_euler_all_neg<Y,Z,X>(ea);
165 verify_euler_all_neg<Y,Z,Y>(ea);
166 verify_euler_all_neg<Y,X,Z>(ea);
167 verify_euler_all_neg<Y,X,Y>(ea);
169 verify_euler_all_neg<Z,X,Y>(ea);
170 verify_euler_all_neg<Z,X,Z>(ea);
171 verify_euler_all_neg<Z,Y,X>(ea);
172 verify_euler_all_neg<Z,Y,Z>(ea);
201 const Vector3 Zero = Vector3::Zero();
220 for (
int i = 0;
i <
alpha.size(); ++
i) {
221 for (
int j = 0;
j <
beta.size(); ++
j) {
222 for (
int k = 0; k <
gamma.size(); ++k) {
239 q1 = AngleAxisType(
a, Vector3::Random().normalized());
245 ea =
m.eulerAngles(0,1,0);
249 q1.coeffs() = Quaternionx::Coefficients::Random().normalized();
251 ea =
m.eulerAngles(0,1,2);
253 ea =
m.eulerAngles(0,1,0);
257 ea = (Array3::Random() + Array3(1,0,0))*
Scalar(
EIGEN_PI)*Array3(0.5,1,1);
269 ea.head(2).setZero();
279 EulerAnglesXYZd onesEd(1, 1, 1);
280 EulerAnglesXYZf onesEf = onesEd.cast<
float>();