Verified Commit 8196a07c authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: remove enable_early_stopping

parent 9f2d194d
Pipeline #13756 passed with stage
in 52 minutes and 42 seconds
...@@ -107,8 +107,7 @@ public: ...@@ -107,8 +107,7 @@ public:
solver.support_func_cached_guess = request.cached_support_func_guess; solver.support_func_cached_guess = request.cached_support_func_guess;
} }
if(request.enable_early_stopping) solver.distance_upper_bound = request.distance_upper_bound;
solver.distance_upper_bound = request.distance_upper_bound;
std::size_t res; std::size_t res;
if (swap_geoms) { if (swap_geoms) {
......
...@@ -192,7 +192,6 @@ enum CollisionRequestFlag ...@@ -192,7 +192,6 @@ enum CollisionRequestFlag
{ {
CONTACT = 0x00001, CONTACT = 0x00001,
DISTANCE_LOWER_BOUND = 0x00002, DISTANCE_LOWER_BOUND = 0x00002,
EARLY_STOPPING = 0x00004,
NO_REQUEST = 0x01000 NO_REQUEST = 0x01000
}; };
...@@ -208,9 +207,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest ...@@ -208,9 +207,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
/// Whether a lower bound on distance is returned when objects are disjoint /// Whether a lower bound on distance is returned when objects are disjoint
bool enable_distance_lower_bound; bool enable_distance_lower_bound;
/// Whether GJK stops when it proves that the distance between two geometries is greater than distance_upper_bound.
bool enable_early_stopping;
/// @brief Distance below which objects are considered in collision. /// @brief Distance below which objects are considered in collision.
/// See \ref hpp_fcl_collision_and_distance_lower_bound_computation /// See \ref hpp_fcl_collision_and_distance_lower_bound_computation
FCL_REAL security_margin; FCL_REAL security_margin;
...@@ -229,7 +225,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest ...@@ -229,7 +225,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
num_max_contacts(num_max_contacts_), num_max_contacts(num_max_contacts_),
enable_contact(flag & CONTACT), enable_contact(flag & CONTACT),
enable_distance_lower_bound (flag & DISTANCE_LOWER_BOUND), enable_distance_lower_bound (flag & DISTANCE_LOWER_BOUND),
enable_early_stopping (flag & EARLY_STOPPING),
security_margin (0), security_margin (0),
break_distance (1e-3), break_distance (1e-3),
distance_upper_bound ((std::numeric_limits<FCL_REAL>::max)()) distance_upper_bound ((std::numeric_limits<FCL_REAL>::max)())
...@@ -240,7 +235,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest ...@@ -240,7 +235,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
num_max_contacts(1), num_max_contacts(1),
enable_contact(false), enable_contact(false),
enable_distance_lower_bound (false), enable_distance_lower_bound (false),
enable_early_stopping (false),
security_margin (0), security_margin (0),
break_distance (1e-3), break_distance (1e-3),
distance_upper_bound ((std::numeric_limits<FCL_REAL>::max)()) distance_upper_bound ((std::numeric_limits<FCL_REAL>::max)())
...@@ -256,7 +250,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest ...@@ -256,7 +250,6 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
&& num_max_contacts == other.num_max_contacts && num_max_contacts == other.num_max_contacts
&& enable_contact == other.enable_contact && enable_contact == other.enable_contact
&& enable_distance_lower_bound == other.enable_distance_lower_bound && enable_distance_lower_bound == other.enable_distance_lower_bound
&& enable_early_stopping == other.enable_early_stopping
&& security_margin == other.security_margin && security_margin == other.security_margin
&& break_distance == other.break_distance && break_distance == other.break_distance
&& distance_upper_bound == other.distance_upper_bound; && distance_upper_bound == other.distance_upper_bound;
......
...@@ -73,8 +73,7 @@ namespace fcl ...@@ -73,8 +73,7 @@ namespace fcl
details::GJK gjk((unsigned int )gjk_max_iterations, gjk_tolerance); details::GJK gjk((unsigned int )gjk_max_iterations, gjk_tolerance);
if(enable_early_stopping) gjk.setDistanceEarlyBreak(distance_upper_bound);
gjk.setDistanceEarlyBreak(distance_upper_bound);
details::GJK::Status gjk_status = gjk.evaluate(shape, guess, support_hint); details::GJK::Status gjk_status = gjk.evaluate(shape, guess, support_hint);
if(enable_cached_guess) { if(enable_cached_guess) {
...@@ -151,8 +150,7 @@ namespace fcl ...@@ -151,8 +150,7 @@ namespace fcl
details::GJK gjk((unsigned int )gjk_max_iterations, gjk_tolerance); details::GJK gjk((unsigned int )gjk_max_iterations, gjk_tolerance);
if(enable_early_stopping) gjk.setDistanceEarlyBreak(distance_upper_bound);
gjk.setDistanceEarlyBreak(distance_upper_bound);
details::GJK::Status gjk_status = gjk.evaluate(shape, guess, support_hint); details::GJK::Status gjk_status = gjk.evaluate(shape, guess, support_hint);
if(enable_cached_guess) { if(enable_cached_guess) {
...@@ -233,8 +231,7 @@ namespace fcl ...@@ -233,8 +231,7 @@ namespace fcl
details::GJK gjk((unsigned int) gjk_max_iterations, gjk_tolerance); details::GJK gjk((unsigned int) gjk_max_iterations, gjk_tolerance);
if(enable_early_stopping) gjk.setDistanceEarlyBreak(distance_upper_bound);
gjk.setDistanceEarlyBreak(distance_upper_bound);
details::GJK::Status gjk_status = gjk.evaluate(shape, guess, support_hint); details::GJK::Status gjk_status = gjk.evaluate(shape, guess, support_hint);
if(enable_cached_guess) { if(enable_cached_guess) {
...@@ -320,7 +317,6 @@ namespace fcl ...@@ -320,7 +317,6 @@ namespace fcl
enable_cached_guess = false; enable_cached_guess = false;
cached_guess = Vec3f(1, 0, 0); cached_guess = Vec3f(1, 0, 0);
support_func_cached_guess = support_func_guess_t::Zero(); support_func_cached_guess = support_func_guess_t::Zero();
enable_early_stopping = false;
distance_upper_bound = (std::numeric_limits<FCL_REAL>::max)(); distance_upper_bound = (std::numeric_limits<FCL_REAL>::max)();
} }
...@@ -366,12 +362,8 @@ namespace fcl ...@@ -366,12 +362,8 @@ namespace fcl
/// @brief smart guess for the support function /// @brief smart guess for the support function
mutable support_func_guess_t support_func_cached_guess; mutable support_func_guess_t support_func_cached_guess;
/// @brief Whether GJK solver makes an early stopping if it proves that the distance between two geometries /// @brief Distance above which the GJK solver stoppes its computations and processes to an early stopping.
/// is above a certain threshold /// The two witness points are incorrect, but with the guaranty that the two shapes have a distance greather than distance_upper_bound.
mutable bool enable_early_stopping;
/// @brief Distance above which the GJK solver stoppes its computations. The two witness points are incorrect,
/// but with the guaranty that the two shapes have a distance greather than distance_upper_bound.
mutable FCL_REAL distance_upper_bound; mutable FCL_REAL distance_upper_bound;
}; };
......
...@@ -76,7 +76,6 @@ void exposeCollisionAPI () ...@@ -76,7 +76,6 @@ void exposeCollisionAPI ()
enum_ <CollisionRequestFlag> ("CollisionRequestFlag") enum_ <CollisionRequestFlag> ("CollisionRequestFlag")
.value ("CONTACT", CONTACT) .value ("CONTACT", CONTACT)
.value ("DISTANCE_LOWER_BOUND", DISTANCE_LOWER_BOUND) .value ("DISTANCE_LOWER_BOUND", DISTANCE_LOWER_BOUND)
.value ("EARLY_STOPPING", EARLY_STOPPING)
.value ("NO_REQUEST", NO_REQUEST) .value ("NO_REQUEST", NO_REQUEST)
.export_values() .export_values()
; ;
...@@ -104,7 +103,6 @@ void exposeCollisionAPI () ...@@ -104,7 +103,6 @@ void exposeCollisionAPI ()
.DEF_RW_CLASS_ATTRIB (CollisionRequest, enable_distance_lower_bound) .DEF_RW_CLASS_ATTRIB (CollisionRequest, enable_distance_lower_bound)
.DEF_RW_CLASS_ATTRIB (CollisionRequest, security_margin ) .DEF_RW_CLASS_ATTRIB (CollisionRequest, security_margin )
.DEF_RW_CLASS_ATTRIB (CollisionRequest, break_distance ) .DEF_RW_CLASS_ATTRIB (CollisionRequest, break_distance )
.DEF_RW_CLASS_ATTRIB (CollisionRequest, enable_early_stopping )
.DEF_RW_CLASS_ATTRIB (CollisionRequest, distance_upper_bound ) .DEF_RW_CLASS_ATTRIB (CollisionRequest, distance_upper_bound )
; ;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment