38 #include <boost/test/tools/old/interface.hpp>
39 #define BOOST_TEST_MODULE FCL_NESTEROV_GJK
40 #include <boost/test/included/unit_test.hpp>
42 #include <Eigen/Geometry>
72 BOOST_CHECK(
gjk.convergence_criterion_type ==
87 BOOST_CHECK(
gjk.convergence_criterion_type ==
94 unsigned int max_iterations = 128;
96 GJK gjk1(max_iterations, 1e-6);
108 throw std::logic_error(
"Wrong convergence criterion type");
111 GJK gjk2(max_iterations, tol);
115 GJK gjk3(max_iterations, tol);
125 std::vector<Transform3f> transforms;
132 init_support_guess.setZero();
135 for (
size_t i = 0; i < n; ++i) {
136 mink_diff.
set(&shape0, &shape1, identity, transforms[i]);
138 GJK::Status res1 = gjk1.
evaluate(mink_diff, init_guess, init_support_guess);
141 res1 = gjk1.
evaluate(mink_diff, init_guess, init_support_guess);
142 BOOST_CHECK(res1 != GJK::Status::Failed);
145 GJK::Status res2 = gjk2.
evaluate(mink_diff, init_guess, init_support_guess);
148 res2 = gjk2.
evaluate(mink_diff, init_guess, init_support_guess);
149 BOOST_CHECK(res2 != GJK::Status::Failed);
152 GJK::Status res3 = gjk3.
evaluate(mink_diff, init_guess, init_support_guess);
155 res3 = gjk3.
evaluate(mink_diff, init_guess, init_support_guess);
156 BOOST_CHECK(res3 != GJK::Status::Failed);
166 Box box0 =
Box(0.1, 0.2, 0.3);
167 Box box1 =
Box(1.1, 1.2, 1.3);