Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
coal::details::EPA Struct Reference

class for EPA algorithm More...

#include <gjk.h>

Classes

struct  SimplexFace
 
struct  SimplexFaceList
 The simplex list of EPA is a linked list of faces. Note: EPA's linked list does not own any memory. The memory it refers to is contiguous and owned by a std::vector. More...
 
struct  SimplexHorizon
 

Public Types

typedef GJK::SimplexV SimplexVertex
 
enum  Status {
  DidNotRun = -1, Failed = 0, Valid = 1, AccuracyReached = 1 << 1 | Valid,
  Degenerated = 1 << 1 | Failed, NonConvex = 2 << 1 | Failed, InvalidHull = 3 << 1 | Failed, OutOfFaces = 4 << 1 | Failed,
  OutOfVertices = 5 << 1 | Failed, FallBack = 6 << 1 | Failed
}
 

Public Member Functions

 EPA (const EPA &other)
 Copy constructor of EPA. Mostly needed for the copy constructor of GJKSolver. More...
 
 EPA (size_t max_iterations_, CoalScalar tolerance_)
 
Status evaluate (GJK &gjk, const Vec3s &guess)
 
size_t getNumFaces () const
 Get the number of faces in the polytope of the last run of EPA. More...
 
size_t getNumIterations () const
 Get the number of iterations of the last run of EPA. More...
 
size_t getNumMaxFaces () const
 Get the max number of faces of EPA. More...
 
size_t getNumMaxIterations () const
 Get the max number of iterations of EPA. More...
 
size_t getNumMaxVertices () const
 Get the max number of vertices of EPA. More...
 
size_t getNumVertices () const
 Get the number of vertices in the polytope of the last run of EPA. More...
 
CoalScalar getTolerance () const
 Get the tolerance of EPA. More...
 
void getWitnessPointsAndNormal (const MinkowskiDiff &shape, Vec3s &w0, Vec3s &w1, Vec3s &normal) const
 
void reset (size_t max_iterations, CoalScalar tolerance)
 resets the EPA algorithm, preparing it for a new run. It potentially reallocates memory for the vertices and faces if the passed parameters are bigger than the previous ones. This function does not modify the parameters of the EPA algorithm, i.e. the maximum number of iterations and the tolerance. More...
 

Static Public Member Functions

static void bind (SimplexFace *fa, size_t ea, SimplexFace *fb, size_t eb)
 We bind the face fa along its edge ea to the face fb along its edge fb. More...
 

Public Attributes

SimplexFaceclosest_face
 
CoalScalar depth
 
Vec3s normal
 
GJK::Simplex result
 
Status status
 
support_func_guess_t support_hint
 

Private Member Functions

bool expand (size_t pass, const SimplexVertex &w, SimplexFace *f, size_t e, SimplexHorizon &horizon)
 the goal is to add a face connecting vertex w and face edge f[e] More...
 
SimplexFacefindClosestFace ()
 Find the best polytope face to split. More...
 
bool getEdgeDist (SimplexFace *face, const SimplexVertex &a, const SimplexVertex &b, CoalScalar &dist)
 
void initialize ()
 Allocates memory for the EPA algorithm. This function should only be called by the constructor. Otherwise use reset. More...
 
SimplexFacenewFace (size_t id_a, size_t id_b, size_t id_vertex, bool force=false)
 Add a new face to the polytope. This function sets the ignore flag to true if the origin does not project inside the face. More...
 

Private Attributes

std::vector< SimplexFacefc_store
 
SimplexFaceList hull
 
size_t iterations
 
size_t max_iterations
 
size_t num_vertices
 
SimplexFaceList stock
 
std::vector< SimplexVertexsv_store
 
CoalScalar tolerance
 

Detailed Description

class for EPA algorithm

Definition at line 258 of file coal/narrowphase/gjk.h.

Member Typedef Documentation

◆ SimplexVertex

Definition at line 259 of file coal/narrowphase/gjk.h.

Member Enumeration Documentation

◆ Status

Enumerator
DidNotRun 
Failed 
Valid 
AccuracyReached 
Degenerated 
NonConvex 
InvalidHull 
OutOfFaces 
OutOfVertices 
FallBack 

Definition at line 329 of file coal/narrowphase/gjk.h.

Constructor & Destructor Documentation

◆ EPA() [1/2]

coal::details::EPA::EPA ( size_t  max_iterations_,
CoalScalar  tolerance_ 
)
inline

Definition at line 363 of file coal/narrowphase/gjk.h.

◆ EPA() [2/2]

coal::details::EPA::EPA ( const EPA other)
inline

Copy constructor of EPA. Mostly needed for the copy constructor of GJKSolver.

Definition at line 370 of file coal/narrowphase/gjk.h.

Member Function Documentation

◆ bind()

static void coal::details::EPA::bind ( SimplexFace fa,
size_t  ea,
SimplexFace fb,
size_t  eb 
)
inlinestatic

We bind the face fa along its edge ea to the face fb along its edge fb.

Definition at line 311 of file coal/narrowphase/gjk.h.

◆ evaluate()

EPA::Status coal::details::EPA::evaluate ( GJK gjk,
const Vec3s guess 
)
Returns
a Status which can be demangled using (status & Valid) or (status & Failed). The other values provide a more detailled status

Definition at line 1157 of file src/narrowphase/gjk.cpp.

◆ expand()

bool coal::details::EPA::expand ( size_t  pass,
const SimplexVertex w,
SimplexFace f,
size_t  e,
SimplexHorizon horizon 
)
private

the goal is to add a face connecting vertex w and face edge f[e]

Definition at line 1362 of file src/narrowphase/gjk.cpp.

◆ findClosestFace()

EPA::SimplexFace * coal::details::EPA::findClosestFace ( )
private

Find the best polytope face to split.

Definition at line 1142 of file src/narrowphase/gjk.cpp.

◆ getEdgeDist()

bool coal::details::EPA::getEdgeDist ( SimplexFace face,
const SimplexVertex a,
const SimplexVertex b,
CoalScalar dist 
)
private

Definition at line 1040 of file src/narrowphase/gjk.cpp.

◆ getNumFaces()

size_t coal::details::EPA::getNumFaces ( ) const
inline

Get the number of faces in the polytope of the last run of EPA.

Definition at line 397 of file coal/narrowphase/gjk.h.

◆ getNumIterations()

size_t coal::details::EPA::getNumIterations ( ) const
inline

Get the number of iterations of the last run of EPA.

Definition at line 391 of file coal/narrowphase/gjk.h.

◆ getNumMaxFaces()

size_t coal::details::EPA::getNumMaxFaces ( ) const
inline

Get the max number of faces of EPA.

Definition at line 385 of file coal/narrowphase/gjk.h.

◆ getNumMaxIterations()

size_t coal::details::EPA::getNumMaxIterations ( ) const
inline

Get the max number of iterations of EPA.

Definition at line 379 of file coal/narrowphase/gjk.h.

◆ getNumMaxVertices()

size_t coal::details::EPA::getNumMaxVertices ( ) const
inline

Get the max number of vertices of EPA.

Definition at line 382 of file coal/narrowphase/gjk.h.

◆ getNumVertices()

size_t coal::details::EPA::getNumVertices ( ) const
inline

Get the number of vertices in the polytope of the last run of EPA.

Definition at line 394 of file coal/narrowphase/gjk.h.

◆ getTolerance()

CoalScalar coal::details::EPA::getTolerance ( ) const
inline

Get the tolerance of EPA.

Definition at line 388 of file coal/narrowphase/gjk.h.

◆ getWitnessPointsAndNormal()

void coal::details::EPA::getWitnessPointsAndNormal ( const MinkowskiDiff shape,
Vec3s w0,
Vec3s w1,
Vec3s normal 
) const

Get the witness points on each object, and the corresponding normal.

Parameters
[in]shapeis the Minkowski difference of the two shapes.
[out]w0is the witness point on shape0.
[out]w1is the witness point on shape1.
[in]normalis the normal found by EPA. It points from shape0 to shape1. The normal is used to correct the witness points on the shapes if the shapes have a non-zero swept-sphere radius.

Definition at line 1452 of file src/narrowphase/gjk.cpp.

◆ initialize()

void coal::details::EPA::initialize ( )
private

Allocates memory for the EPA algorithm. This function should only be called by the constructor. Otherwise use reset.

Definition at line 1013 of file src/narrowphase/gjk.cpp.

◆ newFace()

EPA::SimplexFace * coal::details::EPA::newFace ( size_t  id_a,
size_t  id_b,
size_t  id_vertex,
bool  force = false 
)
private

Add a new face to the polytope. This function sets the ignore flag to true if the origin does not project inside the face.

Definition at line 1069 of file src/narrowphase/gjk.cpp.

◆ reset()

void coal::details::EPA::reset ( size_t  max_iterations,
CoalScalar  tolerance 
)

resets the EPA algorithm, preparing it for a new run. It potentially reallocates memory for the vertices and faces if the passed parameters are bigger than the previous ones. This function does not modify the parameters of the EPA algorithm, i.e. the maximum number of iterations and the tolerance.

Note
calling this function destroys the previous state of EPA. In the future, we may want to copy it instead, i.e. when EPA will be (properly) warm-startable.

Definition at line 1015 of file src/narrowphase/gjk.cpp.

Member Data Documentation

◆ closest_face

SimplexFace* coal::details::EPA::closest_face

Definition at line 348 of file coal/narrowphase/gjk.h.

◆ depth

CoalScalar coal::details::EPA::depth

Definition at line 347 of file coal/narrowphase/gjk.h.

◆ fc_store

std::vector<SimplexFace> coal::details::EPA::fc_store
private

Definition at line 357 of file coal/narrowphase/gjk.h.

◆ hull

SimplexFaceList coal::details::EPA::hull
private

Definition at line 358 of file coal/narrowphase/gjk.h.

◆ iterations

size_t coal::details::EPA::iterations
private

Definition at line 360 of file coal/narrowphase/gjk.h.

◆ max_iterations

size_t coal::details::EPA::max_iterations
private

Definition at line 353 of file coal/narrowphase/gjk.h.

◆ normal

Vec3s coal::details::EPA::normal

Definition at line 345 of file coal/narrowphase/gjk.h.

◆ num_vertices

size_t coal::details::EPA::num_vertices
private

Definition at line 359 of file coal/narrowphase/gjk.h.

◆ result

GJK::Simplex coal::details::EPA::result

Definition at line 344 of file coal/narrowphase/gjk.h.

◆ status

Status coal::details::EPA::status

Definition at line 343 of file coal/narrowphase/gjk.h.

◆ stock

SimplexFaceList coal::details::EPA::stock
private

Definition at line 358 of file coal/narrowphase/gjk.h.

◆ support_hint

support_func_guess_t coal::details::EPA::support_hint

Definition at line 346 of file coal/narrowphase/gjk.h.

◆ sv_store

std::vector<SimplexVertex> coal::details::EPA::sv_store
private

Definition at line 356 of file coal/narrowphase/gjk.h.

◆ tolerance

CoalScalar coal::details::EPA::tolerance
private

Definition at line 354 of file coal/narrowphase/gjk.h.


The documentation for this struct was generated from the following files:


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:45:00