mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 02:26:16 +00:00
a/math: Add disabled test to show problem with current quat_exp implementation
This commit is contained in:
parent
6bc551d004
commit
e7c3376612
|
@ -80,6 +80,9 @@ quat_exp(Eigen::MatrixBase<Derived> const &vec)
|
||||||
/// whose absence thus distinguishes this implementation. Without
|
/// whose absence thus distinguishes this implementation. Without
|
||||||
/// that factor of 1/2, the exp and ln functions successfully
|
/// that factor of 1/2, the exp and ln functions successfully
|
||||||
/// round-trip and match other implementations.
|
/// 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 theta = vec.norm();
|
||||||
Scalar vecscale = sinc(theta);
|
Scalar vecscale = sinc(theta);
|
||||||
Eigen::Quaternion<Scalar> ret;
|
Eigen::Quaternion<Scalar> ret;
|
||||||
|
|
|
@ -75,4 +75,21 @@ TEST_CASE("m_quatexpmap")
|
||||||
CHECK(m_vec3_len(expected_aa - aa) <= 0.001);
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue