diff --git a/test/test_fcl_geometric_shapes.cpp b/test/test_fcl_geometric_shapes.cpp index 638c6d9f133eda61d6d6594c7ab0e217964306ef..624fff11c15550f9641bae4c7f197985c17167b7 100644 --- a/test/test_fcl_geometric_shapes.cpp +++ b/test/test_fcl_geometric_shapes.cpp @@ -1919,7 +1919,7 @@ BOOST_AUTO_TEST_CASE(shapeDistance_spheresphere) } BOOST_AUTO_TEST_CASE(shapeDistance_boxbox) -{ +{ Box s1(20, 40, 50); Box s2(10, 10, 10); Vec3f closest_p1, closest_p2; @@ -1938,25 +1938,20 @@ BOOST_AUTO_TEST_CASE(shapeDistance_boxbox) BOOST_CHECK(dist < 0); BOOST_CHECK_FALSE(res); - std::cerr << " SOVLER NUMBER 1" << std::endl; res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist, &closest_p1, &closest_p2); - std::cerr << "computed points in box to box" << closest_p1 << " & " << closest_p2 << "with dist: " << dist<< std::endl; BOOST_CHECK(fabs(dist - 0.1) < 0.001); BOOST_CHECK(res); res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(20.1, 0, 0)), &dist, &closest_p1, &closest_p2); - std::cerr << "computed points in box to box" << closest_p1 << " & " << closest_p2 << "with dist: " << dist<< std::endl; BOOST_CHECK(fabs(dist - 10.1) < 0.001); BOOST_CHECK(res); - res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(0, 20.1, 0)), &dist, &closest_p1, &closest_p2); - std::cerr << "computed points in box to box" << closest_p1 << " & " << closest_p2 << "with dist: " << dist<< std::endl; - BOOST_CHECK(fabs(dist - 10.1) < 0.001); + res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(0, 20.2, 0)), &dist, &closest_p1, &closest_p2); + BOOST_CHECK(fabs(dist - 10.2) < 0.001); BOOST_CHECK(res); res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 10.1, 0)), &dist, &closest_p1, &closest_p2); - std::cerr << "computed points in box to box" << closest_p1 << " & " << closest_p2 << "with dist: " << dist<< std::endl; - BOOST_CHECK(fabs(dist - std::sqrt(.1*.1 + .1*.1)) < 0.001); + BOOST_CHECK(fabs(dist - 0.1 * 1.414) < 0.001); BOOST_CHECK(res); res = solver2.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist, &closest_p1, &closest_p2); @@ -1972,7 +1967,7 @@ BOOST_AUTO_TEST_CASE(shapeDistance_boxbox) BOOST_CHECK(res); res = solver2.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 10.1, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - std::sqrt(.1*.1 + .1*.1)) < 0.001); + BOOST_CHECK(fabs(dist - 0.1 * 1.414) < 0.001); BOOST_CHECK(res);