Go to the documentation of this file.
60 typedef Eigen::Array<FCL_REAL, 1, 2>
Array2d;
98 const Vec3f& dir,
bool dirIsNormalized,
105 : linear_log_convex_threshold(32),
106 normalize_support_direction(false),
107 getSupportFunc(NULL) {}
119 return getSupport(shapes[0], d, dIsNormalized, hint);
125 getSupport(shapes[1], oR1.transpose() * d, dIsNormalized, hint) +
132 assert(getSupportFunc != NULL);
133 getSupportFunc(*
this, d, dIsNormalized, supp0, supp1, hint,
141 struct HPP_FCL_DLLAPI
GJK {
197 : max_iterations(max_iterations_), tolerance(tolerance_) {
212 shape->
support(d, dIsNormalized, sv.
w0, sv.
w1, hint);
213 sv.
w = sv.
w0 - sv.
w1;
217 bool encloseOrigin();
239 Vec3f getGuessFromSimplex()
const;
246 distance_upper_bound = dup;
274 inline void removeVertex(
Simplex& simplex);
277 inline void appendVertex(
Simplex& simplex,
const Vec3f&
v,
bool isNormalized,
299 bool projectTriangleOrigin(
const Simplex& current,
Simplex& next);
303 bool projectTetrahedraOrigin(
const Simplex& current,
Simplex& next);
312 struct HPP_FCL_DLLAPI
EPA {
333 if (root) root->
l[0] = face;
339 if (face->
l[1]) face->
l[1]->
l[0] = face->
l[0];
340 if (face->
l[0]) face->
l[0]->
l[1] = face->
l[1];
341 if (face == root) root = face->
l[1];
370 AccuracyReached = 1 << 1 | Valid,
371 Degenerated = 1 << 1 | Failed,
372 NonConvex = 2 << 1 | Failed,
373 InvalidHull = 3 << 1 | Failed,
374 OutOfFaces = 4 << 1 | Failed,
375 OutOfVertices = 5 << 1 | Failed,
376 FallBack = 6 << 1 | Failed
388 EPA(
unsigned int max_face_num_,
unsigned int max_vertex_num_,
389 unsigned int max_iterations_,
FCL_REAL tolerance_)
390 : max_face_num(max_face_num_),
391 max_vertex_num(max_vertex_num_),
392 max_iterations(max_iterations_),
393 tolerance(tolerance_) {
414 bool getEdgeDist(SimplexF* face, SimplexV* a, SimplexV*
b,
FCL_REAL& dist);
416 SimplexF* newFace(SimplexV* a, SimplexV*
b, SimplexV* vertex,
bool forced);
419 SimplexF* findBest();
422 bool expand(
size_t pass, SimplexV* w, SimplexF* f,
size_t e,
423 SimplexHorizon& horizon);
void getSupport(const Vec3f &d, bool dIsNormalized, SimplexV &sv, support_func_guess_t &hint) const
apply the support function along a direction, the result is return in sv
MinkowskiDiff const * shape
GJKConvergenceCriterionType
Wether the convergence criterion is scaled on the norm of the solution or not.
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
void support(const Vec3f &d, bool dIsNormalized, Vec3f &supp0, Vec3f &supp1, support_func_guess_t &hint) const
support function for the pair of shapes
bool getClosestPoints(const GJK::Simplex &simplex, Vec3f &w0, Vec3f &w1)
unsigned int max_face_num
support_func_guess_t support_hint
size_t getIterations()
Get GJK number of iterations.
EPA(unsigned int max_face_num_, unsigned int max_vertex_num_, unsigned int max_iterations_, FCL_REAL tolerance_)
GJKConvergenceCriterion
Which convergence criterion is used to stop the algorithm (when the shapes are not in collision)....
bool initialize(MeshCollisionTraversalNode< BV, RelativeTransformationIsIdentity > &node, BVHModel< BV > &model1, Transform3f &tf1, BVHModel< BV > &model2, Transform3f &tf2, CollisionResult &result, bool use_refit=false, bool refit_bottomup=false)
Initialize traversal node for collision between two meshes, given the current transforms.
FCL_REAL getTolerance()
Get GJK tolerance.
static const size_t EPA_MAX_FACES
HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
static const size_t EPA_MAX_VERTICES
Vec3f w
support vector (i.e., the furthest point on the shape along the support direction)
Vec3f getSupport(const ShapeBase *shape, const Vec3f &dir, bool dirIsNormalized, int &hint)
the support function for shape
GJK(unsigned int max_iterations_, FCL_REAL tolerance_)
unsigned int max_vertex_num
Minkowski difference class of two shapes.
static void bind(SimplexF *fa, size_t ea, SimplexF *fb, size_t eb)
Simplex * getSimplex() const
get the underlying simplex using in GJK, can be used for cache in next iteration
Status
Status of the GJK algorithm: Valid: GJK converged and the shapes are not in collision....
int linear_log_convex_threshold
Number of points in a Convex object from which using a logarithmic support function is faster than a ...
FCL_REAL distance_upper_bound
Eigen::Vector2i support_func_guess_t
void append(SimplexF *face)
GetSupportFunction getSupportFunc
void remove(SimplexF *face)
static const size_t EPA_MAX_ITERATIONS
Vec3f support1(const Vec3f &d, bool dIsNormalized, int &hint) const
support function for shape1
Vec3f support0(const Vec3f &d, bool dIsNormalized, int &hint) const
support function for shape0
unsigned int max_iterations
Vec3f w0
support vector for shape 0 and 1.
static const FCL_REAL EPA_EPS
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
unsigned char vertex_id_t
GJKConvergenceCriterion convergence_criterion
void setDistanceEarlyBreak(const FCL_REAL &dup)
Distance threshold for early break. GJK stops when it proved the distance is more than this threshold...
vertex_id_t rank
size of simplex (number of vertices)
Eigen::Array< FCL_REAL, 1, 2 > Array2d
bool hasClosestPoints()
Tells whether the closest points are available.
bool normalize_support_direction
Wether or not to use the normalize heuristic in the GJK Nesterov acceleration. This setting is only a...
GJKConvergenceCriterionType convergence_criterion_type
Base class for all basic geometric shapes.
unsigned int max_iterations
Matrix3f oR1
rotation from shape1 to shape0 such that .
GJKVariant
Variant to use for the GJK algorithm.
Vec3f ot1
translation from shape1 to shape0 such that .
bool hasPenetrationInformation(const MinkowskiDiff &shape)
std::vector< int8_t > visited
Array2d inflation
The radius of the sphere swepted volume. The 2 values correspond to the inflation of shape 0 and shap...
hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:13