15 typedef typename Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
16 typedef typename Eigen::Matrix<Scalar, 3, 3, Options> Matrix3;
17 typedef typename Vector3::Index Index;
19 typedef typename Eigen::AngleAxis<Scalar> AngleAxis;
22 bp::def(
"toEulerAngles", &EulerAnglesConvertor::toEulerAngles,
23 bp::args(
"rotation_matrix",
"a0",
"a1",
"a2"),
24 "It returns the Euler-angles of the rotation matrix mat using the " 25 "convention defined by the triplet (a0,a1,a2).");
27 bp::def(
"fromEulerAngles", &EulerAnglesConvertor::fromEulerAngles,
28 bp::args(
"euler_angles",
"a0",
"a1",
"a2"),
29 "It returns the rotation matrix associated to the Euler angles " 30 "using the convention defined by the triplet (a0,a1,a2).");
33 static Vector3 toEulerAngles(
const Matrix3& mat, Index a0, Index a1,
35 return mat.eulerAngles(a0, a1, a2);
38 static Matrix3 fromEulerAngles(
const Vector3& ea, Index a0, Index a1,
41 mat = AngleAxis(ea[0], Vector3::Unit(a0)) *
42 AngleAxis(ea[1], Vector3::Unit(a1)) *
43 AngleAxis(ea[2], Vector3::Unit(a2));