37 #define BOOST_TEST_MODULE COAL_NESTEROV_GJK
38 #include <boost/test/included/unit_test.hpp>
39 #include <boost/test/tools/old/interface.hpp>
41 #include <Eigen/Geometry>
73 BOOST_CHECK(
gjk.convergence_criterion_type ==
88 BOOST_CHECK(
gjk.convergence_criterion_type ==
95 unsigned int max_iterations = 128;
97 GJK gjk1(max_iterations, 1e-6);
109 throw std::logic_error(
"Wrong convergence criterion type");
112 GJK gjk2(max_iterations, tol);
116 GJK gjk3(max_iterations, tol);
126 std::vector<Transform3s> transforms;
133 init_support_guess.setZero();
136 for (
size_t i = 0; i < n; ++i) {
137 mink_diff.
set<
false>(&shape0, &shape1, identity, transforms[i]);
139 GJK::Status res1 = gjk1.
evaluate(mink_diff, init_guess, init_support_guess);
142 res1 = gjk1.
evaluate(mink_diff, init_guess, init_support_guess);
143 BOOST_CHECK(res1 != GJK::Status::Failed);
146 GJK::Status res2 = gjk2.
evaluate(mink_diff, init_guess, init_support_guess);
149 res2 = gjk2.
evaluate(mink_diff, init_guess, init_support_guess);
150 BOOST_CHECK(res2 != GJK::Status::Failed);
153 GJK::Status res3 = gjk3.
evaluate(mink_diff, init_guess, init_support_guess);
156 res3 = gjk3.
evaluate(mink_diff, init_guess, init_support_guess);
157 BOOST_CHECK(res3 != GJK::Status::Failed);
167 Box box0 =
Box(0.1, 0.2, 0.3);
168 Box box1 =
Box(1.1, 1.2, 1.3);