Unverified Commit b964aba4 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #1148 from jmirabel/devel

[test] test quaternion::uniformRandom
parents ea5785ff bf408c47
......@@ -28,5 +28,19 @@ BOOST_AUTO_TEST_CASE(test_assignQuaternion)
}
}
BOOST_AUTO_TEST_CASE(test_uniformRandom)
{
srand(0);
using namespace pinocchio;
Eigen::Quaternion<double> q;
for (int i = 0; i < (1 << 10); ++i) {
quaternion::uniformRandom(q);
BOOST_CHECK_MESSAGE((q.coeffs().array().abs() <= 1).all(),
"Quaternion coeffs out of bounds: " << i << ' ' << q.coeffs().transpose());
}
}
BOOST_AUTO_TEST_SUITE_END()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment