a/math: Add disabled test to show problem with current quat_exp implementation

This commit is contained in:
Mateo de Mayo 2022-06-02 11:23:20 -03:00 committed by Jakob Bornecrantz
parent 6bc551d004
commit e7c3376612
2 changed files with 20 additions and 0 deletions

View file

@ -80,6 +80,9 @@ quat_exp(Eigen::MatrixBase<Derived> const &vec)
/// whose absence thus distinguishes this implementation. Without
/// that factor of 1/2, the exp and ln functions successfully
/// round-trip and match other implementations.
///
/// @todo That 1/2 term is important, fix it and enable disabled test on
/// tests_quatexpmap.cpp
Scalar theta = vec.norm();
Scalar vecscale = sinc(theta);
Eigen::Quaternion<Scalar> ret;

View file

@ -75,4 +75,21 @@ TEST_CASE("m_quatexpmap")
CHECK(m_vec3_len(expected_aa - aa) <= 0.001);
}
}
//! @todo Fix quat_exp
#if 0
SECTION("Test quat_exp(angle_axis) returns the appropriate quaternion")
{
float angle = M_PI_2;
xrt_vec3 axis = axis4;
xrt_vec3 aa = axis * angle;
xrt_quat q{};
math_quat_exp(&aa, &q);
CHECK(q.x == Approx(axis.x * sin(angle / 2)));
CHECK(q.y == Approx(axis.y * sin(angle / 2)));
CHECK(q.z == Approx(axis.z * sin(angle / 2)));
CHECK(q.w == Approx(cos(angle / 2)));
}
#endif
}