Closed a-price closed 4 years ago
Individual test results:
[==========] Running 7 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 4 tests from FCL_NEGATIVE_DISTANCE
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_sphere_ccd
[ OK ] FCL_NEGATIVE_DISTANCE.sphere_sphere_ccd (1 ms)
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_sphere_indep
[ OK ] FCL_NEGATIVE_DISTANCE.sphere_sphere_indep (0 ms)
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_capsule_ccd
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:143: Failure
Value of: CompareMatrices(result.nearest_points[0], Vector3<S>(20, 0, 0), request.distance_tolerance)
Actual: false (Values at (2, 0) exceed tolerance: -0.0045514721423387527 vs. 0, diff = 0.0045514721423387527, tolerance = 9.9999999999999995e-07
m1 =
20
0
-0.0045514721423387527
m2 =
20
0
0
delta=
0
0
-0.0045514721423387527)
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:145: Failure
Value of: CompareMatrices(result.nearest_points[1], Vector3<S>(30, 0, 0), request.distance_tolerance)
Actual: false (Values at (2, 0) exceed tolerance: -0.004550933837890625 vs. 0, diff = 0.004550933837890625, tolerance = 9.9999999999999995e-07
m1 =
30
0
-0.004550933837890625
m2 =
30
0
0
delta=
0
0
-0.004550933837890625)
Expected: true
[ FAILED ] FCL_NEGATIVE_DISTANCE.sphere_capsule_ccd (0 ms)
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_capsule_indep
[ OK ] FCL_NEGATIVE_DISTANCE.sphere_capsule_indep (0 ms)
[----------] 4 tests from FCL_NEGATIVE_DISTANCE (1 ms total)
[----------] 3 tests from FCL_SIGNED_DISTANCE
[ RUN ] FCL_SIGNED_DISTANCE.cylinder_sphere1_ccd
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:208: Failure
The difference between -(result.nearest_points[0] - result.nearest_points[1]).norm() and result.min_distance is 0.00010422380703955145, which exceeds request.distance_tolerance, where
-(result.nearest_points[0] - result.nearest_points[1]).norm() evaluates to -5.2105533296588825e-05,
result.min_distance evaluates to 5.2118273742962629e-05, and
request.distance_tolerance evaluates to 9.9999999999999995e-07.
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_sphere1_ccd (0 ms)
[ RUN ] FCL_SIGNED_DISTANCE.cylinder_box_ccd
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:248: Failure
Expected: (p_CPc.template head<2>().norm()) <= (cylinder_radius), actual: 0.05 vs 0.05
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:253: Failure
Value of: (p_BPb.array().abs() <= box_size.array() / 2 + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:247: Failure
Expected: (abs(p_CPc(2))) <= (cylinder_length / 2), actual: 0.03 vs 0.03
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_box_ccd (0 ms)
[ RUN ] FCL_SIGNED_DISTANCE.RealWorldRegression
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:329: Failure
Value of: (p_B1P1.array().abs() <= (box1_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:333: Failure
Value of: (p_B2P2.array().abs() <= (box2_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:329: Failure
Value of: (p_B1P1.array().abs() <= (box1_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:333: Failure
Value of: (p_B2P2.array().abs() <= (box2_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:329: Failure
Value of: (p_B1P1.array().abs() <= (box1_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:339: Failure
The difference between result.min_distance and *expected_distance is 1.7823333919864126e-08, which exceeds constants<S>::eps_12(), where
result.min_distance evaluates to -1.7823333919864126e-08,
*expected_distance evaluates to 0, and
constants<S>::eps_12() evaluates to 1.4901161193847656e-08.
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:495: Failure
Expected: fcl::distance(&sphere, &box, request, result) doesn't throw an exception.
Actual: it throws.
[ FAILED ] FCL_SIGNED_DISTANCE.RealWorldRegression (1 ms)
[----------] 3 tests from FCL_SIGNED_DISTANCE (1 ms total)
[----------] Global test environment tear-down
[==========] 7 tests from 2 test cases ran. (2 ms total)
[ PASSED ] 3 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] FCL_NEGATIVE_DISTANCE.sphere_capsule_ccd
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_sphere1_ccd
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_box_ccd
[ FAILED ] FCL_SIGNED_DISTANCE.RealWorldRegression
4 FAILED TESTS
[==========] Running 23 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 23 tests from FCL_GJK_EPA
[ RUN ] FCL_GJK_EPA.faceNormalPointingOutward
[ OK ] FCL_GJK_EPA.faceNormalPointingOutward (1 ms)
[ RUN ] FCL_GJK_EPA.faceNormalPointingOutwardOriginNearFace1
[ OK ] FCL_GJK_EPA.faceNormalPointingOutwardOriginNearFace1 (0 ms)
[ RUN ] FCL_GJK_EPA.faceNormalPointingOutwardOriginNearFace2
[ OK ] FCL_GJK_EPA.faceNormalPointingOutwardOriginNearFace2 (0 ms)
[ RUN ] FCL_GJK_EPA.faceNormalPointingOutwardError
[ OK ] FCL_GJK_EPA.faceNormalPointingOutwardError (0 ms)
[ RUN ] FCL_GJK_EPA.supportEPADirection
[ OK ] FCL_GJK_EPA.supportEPADirection (0 ms)
[ RUN ] FCL_GJK_EPA.supportEPADirectionError
[ OK ] FCL_GJK_EPA.supportEPADirectionError (0 ms)
[ RUN ] FCL_GJK_EPA.isOutsidePolytopeFace
[ OK ] FCL_GJK_EPA.isOutsidePolytopeFace (0 ms)
[ RUN ] FCL_GJK_EPA.isOutsidePolytopeFaceError
[ OK ] FCL_GJK_EPA.isOutsidePolytopeFaceError (0 ms)
[ RUN ] FCL_GJK_EPA.ComputeVisiblePatch_TopFaceVisible
[ OK ] FCL_GJK_EPA.ComputeVisiblePatch_TopFaceVisible (0 ms)
[ RUN ] FCL_GJK_EPA.ComputeVisiblePatch_4FacesVisible
[ OK ] FCL_GJK_EPA.ComputeVisiblePatch_4FacesVisible (0 ms)
[ RUN ] FCL_GJK_EPA.ComputeVisiblePatch_TopAndSideFacesVisible
[ OK ] FCL_GJK_EPA.ComputeVisiblePatch_TopAndSideFacesVisible (0 ms)
[ RUN ] FCL_GJK_EPA.ComputeVisiblePatch_2FacesVisible
[ OK ] FCL_GJK_EPA.ComputeVisiblePatch_2FacesVisible (0 ms)
[ RUN ] FCL_GJK_EPA.ComputeVisiblePatchColinearNewVertex
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:732: Failure
Value of: std::unordered_set<ccd_pt_edge_t*>( {&(tet.e(1)), &(tet.e(4)), &(tet.e(5))})
Actual: { 0x5628b6031550, 0x5628b602fc60, 0x5628b60322d0 }
Expected: border_edges
Which is: { 0x5628b602e810, 0x5628b602ff00, 0x5628b6031550 }
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:733: Failure
Value of: 3u
Actual: 3
Expected: visible_faces.size()
Which is: 1
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:735: Failure
Value of: std::unordered_set<ccd_pt_face_t*>( {&(tet.f(0)), &(tet.f(1)), &(tet.f(3))})
Actual: { 0x5628b602c2f0, 0x5628b602fd20, 0x5628b602fcd0 }
Expected: visible_faces
Which is: { 0x5628b602c2f0 }
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:736: Failure
Value of: 3u
Actual: 3
Expected: internal_edges.size()
Which is: 0
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:738: Failure
Value of: std::unordered_set<ccd_pt_edge_t*>( {&(tet.e(0)), &(tet.e(2)), &(tet.e(3))})
Actual: { 0x5628b602e810, 0x5628b602ff00, 0x5628b602ff70 }
Expected: internal_edges
Which is: {}
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:732: Failure
Value of: std::unordered_set<ccd_pt_edge_t*>( {&(tet.e(1)), &(tet.e(4)), &(tet.e(5))})
Actual: { 0x5628b6035980, 0x5628b602e7a0, 0x5628b6032260 }
Expected: border_edges
Which is: { 0x5628b60315c0, 0x5628b6032180, 0x5628b6035980 }
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:733: Failure
Value of: 3u
Actual: 3
Expected: visible_faces.size()
Which is: 1
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:735: Failure
Value of: std::unordered_set<ccd_pt_face_t*>( {&(tet.f(0)), &(tet.f(1)), &(tet.f(3))})
Actual: { 0x5628b6032340, 0x5628b6030400, 0x5628b6030450 }
Expected: visible_faces
Which is: { 0x5628b6032340 }
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:736: Failure
Value of: 3u
Actual: 3
Expected: internal_edges.size()
Which is: 0
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_epa.cpp:738: Failure
Value of: std::unordered_set<ccd_pt_edge_t*>( {&(tet.e(0)), &(tet.e(2)), &(tet.e(3))})
Actual: { 0x5628b6032180, 0x5628b60315c0, 0x5628b6030280 }
Expected: internal_edges
Which is: {}
[ FAILED ] FCL_GJK_EPA.ComputeVisiblePatchColinearNewVertex (0 ms)
[ RUN ] FCL_GJK_EPA.ComputeVisiblePatchSanityCheck
[ OK ] FCL_GJK_EPA.ComputeVisiblePatchSanityCheck (0 ms)
[ RUN ] FCL_GJK_EPA.expandPolytope_tetrahedron1
[ OK ] FCL_GJK_EPA.expandPolytope_tetrahedron1 (0 ms)
[ RUN ] FCL_GJK_EPA.expandPolytope_tetrahedron_2visible_faces
[ OK ] FCL_GJK_EPA.expandPolytope_tetrahedron_2visible_faces (0 ms)
[ RUN ] FCL_GJK_EPA.expandPolytope_hexagram_1visible_face
[ OK ] FCL_GJK_EPA.expandPolytope_hexagram_1visible_face (0 ms)
[ RUN ] FCL_GJK_EPA.expandPolytope_hexagram_4_visible_faces
[ OK ] FCL_GJK_EPA.expandPolytope_hexagram_4_visible_faces (0 ms)
[ RUN ] FCL_GJK_EPA.expandPolytope_error
[ OK ] FCL_GJK_EPA.expandPolytope_error (0 ms)
[ RUN ] FCL_GJK_EPA.penEPAPosClosest_vertex
[ OK ] FCL_GJK_EPA.penEPAPosClosest_vertex (0 ms)
[ RUN ] FCL_GJK_EPA.penEPAPosClosest_edge
[ OK ] FCL_GJK_EPA.penEPAPosClosest_edge (0 ms)
[ RUN ] FCL_GJK_EPA.penEPAPosClosest_face
[ OK ] FCL_GJK_EPA.penEPAPosClosest_face (0 ms)
[ RUN ] FCL_GJK_EPA.convert2SimplexToTetrahedron
[ OK ] FCL_GJK_EPA.convert2SimplexToTetrahedron (0 ms)
[----------] 23 tests from FCL_GJK_EPA (1 ms total)
[----------] Global test environment tear-down
[==========] 23 tests from 1 test case ran. (1 ms total)
[ PASSED ] 22 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] FCL_GJK_EPA.ComputeVisiblePatchColinearNewVertex
1 FAILED TEST
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from DoSimplex2Test
[ RUN ] DoSimplex2Test.OriginInSimplex
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:72: Failure
Value of: 0
Expected: norm_OB_.dot(phat_OB_)
Which is: 2.98023e-08
[ FAILED ] DoSimplex2Test.OriginInSimplex (0 ms)
[ RUN ] DoSimplex2Test.NeedMoreComputing
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:72: Failure
Value of: 0
Expected: norm_OB_.dot(phat_OB_)
Which is: 2.98023e-08
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:226: Failure
Value of: doSimplex2(&line_, &dir_)
Actual: 1
Expected: kNeedMoreComputing
Which is: 0
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:227: Failure
Value of: is_valid_dir(p_OA, p_OB_, ccd_to_eigen(dir_))
Actual: false (Direction is not perpendicular to the line segments:
dir: -1.2300000190734863 4.559999942779541 7.8899998664855957
p_OA: -0.80178368091583252 1.603567361831665 -2.4053511619567871
p_OB: 0.80178368091583252 -1.603567361831665 2.4053511619567871
dir_hat.dot(phat_AB): 0.38713398575782776 bigger than tolerance << 6.6613381477509392e-16)
Expected: true
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:235: Failure
Value of: doSimplex2(&line_, &dir_)
Actual: 1
Expected: kNeedMoreComputing
Which is: 0
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:236: Failure
Value of: is_valid_dir(p_OA, p_OB_, ccd_to_eigen(dir_))
Actual: false (Direction is not perpendicular to the line segments:
dir: -1.2300000190734863 4.559999942779541 7.8899998664855957
p_OA: -0.80178368091583252 1.603567361831665 -2.4053511619567871
p_OB: 0.80178368091583252 -1.603567361831665 2.4053511619567871
dir_hat.dot(phat_AB): 0.38713398575782776 bigger than tolerance << 6.6613381477509392e-16)
Expected: true
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:245: Failure
Value of: is_valid_dir(p_OA, p_OB_, ccd_to_eigen(dir_))
Actual: false (Direction does not lie on the plane formed by OAB:
dir: 4.8903160095214844 1.603567361831665 -4.3027176856994629
p_OA: -3.6478338241577148 1.603567361831665 -1.4566677808761597
p_OB: 0.80178368091583252 -1.603567361831665 2.4053511619567871
dir.dot(phat_OA.cross(phat_AB)): 2.6822090148925781e-07 bigger than tolerance << 9.420554326178927e-16)
Expected: true
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:254: Failure
Value of: is_valid_dir(p_OA, p_OB_, ccd_to_eigen(dir_))
Actual: false (Direction is not perpendicular to the line segments:
dir: -6.4938831329345703 1.6035670042037964 -0.50798487663269043
p_OA: 2.0442662239074707 1.603567361831665 -3.354034423828125
p_OB: 0.80178368091583252 -1.603567361831665 2.4053511619567871
dir_hat.dot(phat_AB): 1.4901161193847656e-08 bigger than tolerance << 9.420554326178927e-16)
Expected: true
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:262: Failure
Value of: doSimplex2(&line_, &dir_)
Actual: 1
Expected: kNeedMoreComputing
Which is: 0
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:263: Failure
Value of: is_valid_dir(p_OA, p_OB_, ccd_to_eigen(dir_))
Actual: false (Direction is not perpendicular to the line segments:
dir: -1.2300000190734863 4.559999942779541 7.8899998664855957
p_OA: -2672612352 5345224704 -8017837056
p_OB: 0.80178368091583252 -1.603567361831665 2.4053511619567871
dir_hat.dot(phat_AB): 0.38713392615318298 bigger than tolerance << 2.2204460492503131e-06)
Expected: true
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:271: Failure
Value of: doSimplex2(&line_, &dir_)
Actual: 1
Expected: kNeedMoreComputing
Which is: 0
/home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:272: Failure
Value of: is_valid_dir(p_OA, p_OB_, ccd_to_eigen(dir_))
Actual: false (Direction is not perpendicular to the line segments:
dir: -1.2300000190734863 4.559999942779541 7.8899998664855957
p_OA: -2672612352 5345224704 -8017837056
p_OB: 0.80178368091583252 -1.603567361831665 2.4053511619567871
dir_hat.dot(phat_AB): 0.38713392615318298 bigger than tolerance << 2.2204460492503131e-06)
Expected: true
[ FAILED ] DoSimplex2Test.NeedMoreComputing (0 ms)
[----------] 2 tests from DoSimplex2Test (0 ms total)
[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (0 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 2 tests, listed below:
[ FAILED ] DoSimplex2Test.OriginInSimplex
[ FAILED ] DoSimplex2Test.NeedMoreComputing
2 FAILED TESTS
How was libccd
compiled? What's the size of ccd_real_t
inside of FCL?
Alternatively, what scalar type are you using in fcl
? float
or double
?
Maybe I should clarify: this is from running cmake
, make
, and make test
on fcl
, not in code specific to me. Also, if it's relevant, cmake
is at 3.17.0, and g++ is at 7.5.0.
libccd
was compiled with the following cmake
settings:
BUILD_DOCUMENTATION OFF
BUILD_SHARED_LIBS ON
BUILD_TESTING ON
CCD_HIDE_ALL_SYMBOLS OFF
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /home/pricear/local
ENABLE_DOUBLE_PRECISION OFF
LIBM_LIBRARY /usr/lib/x86_64-linux-gnu/libm.so
LIBRT_LIBRARY /usr/lib/x86_64-linux-gnu/librt.so
LIB_SUFFIX
MATH /usr/lib/x86_64-linux-gnu/libm.so
fcl
was compiled with the following cmake
settings:
BUILD_TESTING ON
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /home/pricear/local
Eigen3_DIR /usr/lib/cmake/eigen3
FCL_COVERALLS OFF
FCL_COVERALLS_UPLOAD ON
FCL_ENABLE_PROFILING OFF
FCL_HIDE_ALL_SYMBOLS OFF
FCL_STATIC_LIBRARY OFF
FCL_TREAT_WARNINGS_AS_ERRORS OFF
FCL_USE_HOST_NATIVE_ARCH OFF
FCL_USE_SSE OFF
FCL_USE_X64_SSE ON
FCL_WITH_OCTOMAP ON
ccd_DIR /home/pricear/local/lib/ccd
octomap_DIR /home/pricear/local/share/octomap
Maybe the issue is related to that ENABLE_DOUBLE_PRECISION OFF
flag?
I'll check on ccd_real_t
and report back.
Looks like typedef float ccd_real_t;
is active, and I'm getting sizeof(ccd_real_t)
= 4.
The test coverage for float
is sporadic at best. If you configure libccd to use double, the tests should all pass. Are you using a local build of libccd?
Oh...nevermind. Locally built. Yeah. Enable doubles and things should be much happier.
Ok, rebuilding libccd
leads to sizeof(ccd_real_t)
= 8, which seems good. There was also an apt
-installed version of ccd sneaking around, so I killed that version just in case. The failures have changed slightly, to:
The following tests FAILED:
13 - test_fcl_distance (Failed)
21 - test_fcl_signed_distance (Failed)
32 - test_gjk_libccd-inl_epa (SEGFAULT)
35 - test_gjk_libccd-inl_signed_distance (Failed)
Not a whole lot better. And leads to an ugly mystery.
Obviously these tests pass locally on my machine and in CI, so there's got to be some configuration difference between what you're doing and what we're doing.
Are the failures for those tests similar to what you had previously posted? If not, could you post them?
In the meantime, I'll ponder possible alternate reasons why you're getting different answers.
Yeah, this feels like a linking issue. It may turn out to be something specific to my configuration, so it's questionable how much time should be spent troubleshooting it. Still, it's just building a couple of libraries from head on LTS Ubuntu, so I don't think I'm doing anything too crazy configuration-wise.
Individual test results:
➜ build git:(97455a4) ✗ ./test/test_fcl_distance
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from FCL_DISTANCE
[ RUN ] FCL_DISTANCE.mesh_distance
distance timing: 0.036209 sec
collision timing: 0.026876 sec
[ OK ] FCL_DISTANCE.mesh_distance (2218 ms)
[ RUN ] FCL_DISTANCE.NearestPointFromDegenerateSimplex
/home/pricear/local/srcs/fcl/test/test_fcl_distance.cpp:380: Failure
The difference between expected_dist and result.min_distance is 1.3303674974152191e-08, which exceeds constants<ccd_real_t>::eps_78(), where
expected_dist evaluates to 0.053516162824548998,
result.min_distance evaluates to 0.053516149520874023, and
constants<ccd_real_t>::eps_78() evaluates to 2.0097183471152322e-14.
[ FAILED ] FCL_DISTANCE.NearestPointFromDegenerateSimplex (0 ms)
[----------] 2 tests from FCL_DISTANCE (2218 ms total)
[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (2219 ms total)
[ PASSED ] 1 test.
[ FAILED ] 1 test, listed below:
[ FAILED ] FCL_DISTANCE.NearestPointFromDegenerateSimplex
1 FAILED TEST
➜ build git:(97455a4) ✗ ./test/test_fcl_signed_distance
8
8
[==========] Running 7 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 4 tests from FCL_NEGATIVE_DISTANCE
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_sphere_ccd
[ OK ] FCL_NEGATIVE_DISTANCE.sphere_sphere_ccd (0 ms)
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_sphere_indep
[ OK ] FCL_NEGATIVE_DISTANCE.sphere_sphere_indep (0 ms)
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_capsule_ccd
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:143: Failure
Value of: CompareMatrices(result.nearest_points[0], Vector3<S>(20, 0, 0), request.distance_tolerance)
Actual: false (Values at (2, 0) exceed tolerance: -0.0045514721423387527 vs. 0, diff = 0.0045514721423387527, tolerance = 9.9999999999999995e-07
m1 =
20
0
-0.0045514721423387527
m2 =
20
0
0
delta=
0
0
-0.0045514721423387527)
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:145: Failure
Value of: CompareMatrices(result.nearest_points[1], Vector3<S>(30, 0, 0), request.distance_tolerance)
Actual: false (Values at (2, 0) exceed tolerance: -0.004550933837890625 vs. 0, diff = 0.004550933837890625, tolerance = 9.9999999999999995e-07
m1 =
30
0
-0.004550933837890625
m2 =
30
0
0
delta=
0
0
-0.004550933837890625)
Expected: true
[ FAILED ] FCL_NEGATIVE_DISTANCE.sphere_capsule_ccd (1 ms)
[ RUN ] FCL_NEGATIVE_DISTANCE.sphere_capsule_indep
[ OK ] FCL_NEGATIVE_DISTANCE.sphere_capsule_indep (0 ms)
[----------] 4 tests from FCL_NEGATIVE_DISTANCE (1 ms total)
[----------] 3 tests from FCL_SIGNED_DISTANCE
[ RUN ] FCL_SIGNED_DISTANCE.cylinder_sphere1_ccd
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:208: Failure
The difference between -(result.nearest_points[0] - result.nearest_points[1]).norm() and result.min_distance is 0.00010422380703955145, which exceeds request.distance_tolerance, where
-(result.nearest_points[0] - result.nearest_points[1]).norm() evaluates to -5.2105533296588825e-05,
result.min_distance evaluates to 5.2118273742962629e-05, and
request.distance_tolerance evaluates to 9.9999999999999995e-07.
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_sphere1_ccd (0 ms)
[ RUN ] FCL_SIGNED_DISTANCE.cylinder_box_ccd
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:248: Failure
Expected: (p_CPc.template head<2>().norm()) <= (cylinder_radius), actual: 0.05 vs 0.05
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:253: Failure
Value of: (p_BPb.array().abs() <= box_size.array() / 2 + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:247: Failure
Expected: (abs(p_CPc(2))) <= (cylinder_length / 2), actual: 0.03 vs 0.03
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_box_ccd (0 ms)
[ RUN ] FCL_SIGNED_DISTANCE.RealWorldRegression
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:329: Failure
Value of: (p_B1P1.array().abs() <= (box1_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:333: Failure
Value of: (p_B2P2.array().abs() <= (box2_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:329: Failure
Value of: (p_B1P1.array().abs() <= (box1_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:333: Failure
Value of: (p_B2P2.array().abs() <= (box2_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:329: Failure
Value of: (p_B1P1.array().abs() <= (box1_size / 2).array() + tol).all()
Actual: false
Expected: true
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:339: Failure
The difference between result.min_distance and *expected_distance is 1.7823333919864126e-08, which exceeds constants<S>::eps_12(), where
result.min_distance evaluates to -1.7823333919864126e-08,
*expected_distance evaluates to 0, and
constants<S>::eps_12() evaluates to 1.4901161193847656e-08.
/home/pricear/local/srcs/fcl/test/test_fcl_signed_distance.cpp:495: Failure
Expected: fcl::distance(&sphere, &box, request, result) doesn't throw an exception.
Actual: it throws.
[ FAILED ] FCL_SIGNED_DISTANCE.RealWorldRegression (0 ms)
[----------] 3 tests from FCL_SIGNED_DISTANCE (0 ms total)
[----------] Global test environment tear-down
[==========] 7 tests from 2 test cases ran. (1 ms total)
[ PASSED ] 3 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] FCL_NEGATIVE_DISTANCE.sphere_capsule_ccd
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_sphere1_ccd
[ FAILED ] FCL_SIGNED_DISTANCE.cylinder_box_ccd
[ FAILED ] FCL_SIGNED_DISTANCE.RealWorldRegression
4 FAILED TESTS
AddressSanitizer is reporting a heap-buffer-overflow
in ccdVec3Copy
:
=================================================================
==17624==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60800001e1f8 at pc 0x564af1ac3166 bp 0x7ffd47348880 sp 0x7ffd47348870
READ of size 24 at 0x60800001e1f8 thread T0
#0 0x564af1ac3165 in ccdVec3Copy /home/pricear/local/include/ccd/vec3.h:283
#1 0x564af1ac3165 in penEPAPosClosest /home/pricear/local/srcs/fcl/include/fcl/narrowphase/detail/convexity_based_algorithm/gjk_libccd-inl.h:2142
#2 0x564af1ac43d9 in ccdGJKSignedDist /home/pricear/local/srcs/fcl/include/fcl/narrowphase/detail/convexity_based_algorithm/gjk_libccd-inl.h:2209
#3 0x564af1b0acbf in std::_Function_handler<double (void const*, void const*, _ccd_t const*, _ccd_vec3_t*, _ccd_vec3_t*), double (*)(void const*, void const*, _ccd_t const*, _ccd_vec3_t*, _ccd_vec3_t*)>::_M_invoke(std::_Any_data const&, void const*&&, void const*&&, _ccd_t const*&&, _ccd_vec3_t*&&, _ccd_vec3_t*&&) (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x1cacbf)
#4 0x564af1b0af93 in std::function<double (void const*, void const*, _ccd_t const*, _ccd_vec3_t*, _ccd_vec3_t*)>::operator()(void const*, void const*, _ccd_t const*, _ccd_vec3_t*, _ccd_vec3_t*) const (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x1caf93)
#5 0x564af1afedd1 in bool fcl::detail::GJKDistanceImpl<float>(void*, void (*)(void const*, _ccd_vec3_t const*, _ccd_vec3_t*), void*, void (*)(void const*, _ccd_vec3_t const*, _ccd_vec3_t*), unsigned int, float, std::function<double (void const*, void const*, _ccd_t const*, _ccd_vec3_t*, _ccd_vec3_t*)>, float*, Eigen::Matrix<float, 3, 1, 0, 3, 1>*, Eigen::Matrix<float, 3, 1, 0, 3, 1>*) (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x1bedd1)
#6 0x564af1af1b07 in bool fcl::detail::GJKSignedDistance<float>(void*, void (*)(void const*, _ccd_vec3_t const*, _ccd_vec3_t*), void*, void (*)(void const*, _ccd_vec3_t const*, _ccd_vec3_t*), unsigned int, float, float*, Eigen::Matrix<float, 3, 1, 0, 3, 1>*, Eigen::Matrix<float, 3, 1, 0, 3, 1>*) (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x1b1b07)
#7 0x564af1adb962 in void fcl::detail::TestSphereToSphereGJKSignedDistance<float>(float, float, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, float, float, float) (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x19b962)
#8 0x564af1ad2ab7 in void fcl::detail::TestCollidingSphereGJKSignedDistance<float>() (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x192ab7)
#9 0x564af1ac8057 in fcl::detail::FCL_GJKSignedDistance_sphere_sphere_Test::TestBody() /home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance.cpp:229
#10 0x564af1bb9680 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2081
#11 0x564af1bae4c8 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2117
#12 0x564af1b6c89f in testing::Test::Run() /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2153
#13 0x564af1b6daad in testing::TestInfo::Run() /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2329
#14 0x564af1b6e63b in testing::TestCase::Run() /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2447
#15 0x564af1b7f809 in testing::internal::UnitTestImpl::RunAllTests() /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:4318
#16 0x564af1bbc15d in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2081
#17 0x564af1bb0703 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:2117
#18 0x564af1b7c906 in testing::UnitTest::Run() /home/pricear/local/srcs/fcl/test/gtest/src/gtest.cc:3929
#19 0x564af1aca99f in RUN_ALL_TESTS() (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x18a99f)
#20 0x564af1ac809b in main /home/pricear/local/srcs/fcl/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance.cpp:455
#21 0x7f12bc5e9b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#22 0x564af1aa5eb9 in _start (/home/pricear/local/srcs/fcl/cmake-build-debug/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_signed_distance+0x165eb9)
0x60800001e200 is located 0 bytes to the right of 96-byte region [0x60800001e1a0,0x60800001e200)
allocated by thread T0 here:
#0 0x7f12be1cef30 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef30)
#1 0x7f12bd51e5e7 in ccdPtAddVertex (/home/pricear/local/lib/libccd.so.2+0x75e7)
#2 0x465861ab (<unknown module>)
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/pricear/local/include/ccd/vec3.h:283 in ccdVec3Copy
Shadow bytes around the buggy address:
0x0c107fffbbe0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd
0x0c107fffbbf0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffbc00: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffbc10: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffbc20: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c107fffbc30: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00[00]
0x0c107fffbc40: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffbc50: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffbc60: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffbc70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffbc80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==17624==ABORTING
Process finished with exit code 1
At the very least, we would hope it wouldn't be easy to have such horrible outcomes. :)
The problem you list is highly suggestive of FCL thinking double but libccd library being float still. Can you confirm you're dynamically linking to the version you expect?
ldd
on libfcl.so.0.6.1
is giving the right library for libccd.so.2
. I'm not sure how to look inside libccd.so.2
itself. I'm going to try deleting and re-making it.
➜ build git:(97455a4) ✗ ldd lib/libfcl.so.0.6.1
linux-vdso.so.1 (0x00007ffdecd1b000)
libccd.so.2 => /home/pricear/local/lib/libccd.so.2 (0x00007f35a6d23000)
liboctomap.so.1.9 => /home/pricear/local/lib/liboctomap.so.1.9 (0x00007f35a6ab4000)
liboctomath.so.1.9 => /home/pricear/local/lib/liboctomath.so.1.9 (0x00007f35a68ad000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f35a6524000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f35a6186000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f35a5f6e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f35a5b7d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f35a78f7000)
I was able to reproduce my issue in Docker
:
FROM ubuntu:18.04
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
ca-certificates git cmake g++ libeigen3-dev && \
rm -rf /var/lib/apt/lists/* && apt-get clean
RUN cd ~ && \
git clone --branch v2.1 --depth 1 https://github.com/danfis/libccd.git
RUN cd ~/libccd && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install
# use cmake -DENABLE_DOUBLE_PRECISION=ON for correct build
RUN cd ~ && \
git clone --branch v0.6.1 --depth 1 https://github.com/flexible-collision-library/fcl.git
RUN cd ~/fcl && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc)
RUN cd ~/fcl/build && \
make test
On my host machine, purging everything related to ccd
and fcl
then building from scratch worked.
Would it be appropriate to add
static_assert(std::is_same<double, ccd_real_t>::value, "libccd must be compiled with double precision.");
somewhere?
I'm closing this issue, as it was caused by the missing -DENABLE_DOUBLE_PRECISION=ON
in libccd
.
The static_assert
is a good suggestion. The question is...where? Ostensibly, FCL should work with libccd compiled in float...but it's unclear what happens to precision/solutions when FCL is double and libccd is float. Or if both are float. So, for now, we can at least put a guard in the tests that seem to be the most sensitive to libccd's condition.
I'll ponder this.
I'm getting a couple of test failures when trying to build from source on v0.6.1. I'm on Ubuntu 18.04,
ccd
2.1 (same results with 1.5), andoctomap
1.9.4.The short version:
Long version: