Skip to content
Snippets Groups Projects
Commit c6b6283f authored by Louis Montaut's avatar Louis Montaut
Browse files

BVH: add HPP_FCL_ASSERT to check result of `collide`

parent 16b9331f
No related branches found
No related tags found
No related merge requests found
......@@ -47,11 +47,16 @@ void checkResultLowerBound(const CollisionResult& result,
std::sqrt(Eigen::NumTraits<FCL_REAL>::epsilon());
HPP_FCL_UNUSED_VARIABLE(dummy_precision);
if (sqrDistLowerBound == 0) {
assert(result.distance_lower_bound <= dummy_precision);
HPP_FCL_ASSERT(result.distance_lower_bound <= dummy_precision,
"Distance lower bound should not be positive.",
std::logic_error);
} else {
assert(result.distance_lower_bound * result.distance_lower_bound -
sqrDistLowerBound <
dummy_precision);
HPP_FCL_ASSERT(
result.distance_lower_bound * result.distance_lower_bound -
sqrDistLowerBound <
dummy_precision,
"Distance lower bound and sqrDistLowerBound should coincide.",
std::logic_error);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment