Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | List of all members
tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm Class Reference

This is a modifed Convex to Convex collision algorithm. More...

#include <tesseract_convex_convex_algorithm.h>

Inheritance diagram for tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm:
Inheritance graph
[legend]
Collaboration diagram for tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm:
Collaboration graph
[legend]

Classes

struct  CreateFunc
 

Public Member Functions

 TesseractConvexConvexAlgorithm (btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btConvexPenetrationDepthSolver *pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
 cache separating vector to speedup collision detection More...
 
 ~TesseractConvexConvexAlgorithm () override
 
 TesseractConvexConvexAlgorithm (const TesseractConvexConvexAlgorithm &)=delete
 
TesseractConvexConvexAlgorithmoperator= (const TesseractConvexConvexAlgorithm &)=delete
 
 TesseractConvexConvexAlgorithm (TesseractConvexConvexAlgorithm &&)=delete
 
TesseractConvexConvexAlgorithmoperator= (TesseractConvexConvexAlgorithm &&)=delete
 
void processCollision (const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
 
btScalar calculateTimeOfImpact (btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
 
void getAllContactManifolds (btManifoldArray &manifoldArray) override
 
void setLowLevelOfDetail (bool useLowLevel)
 
const btPersistentManifold * getManifold ()
 

Private Attributes

btConvexPenetrationDepthSolver * m_pdSolver
 
btVertexArray worldVertsB1
 
btVertexArray worldVertsB2
 
bool m_ownManifold { false }
 
btPersistentManifold * m_manifoldPtr
 
bool m_lowLevelOfDetail { false }
 
int m_numPerturbationIterations
 
int m_minimumPointsPerturbationThreshold
 
ContactTestDatam_cdata
 

Detailed Description

This is a modifed Convex to Convex collision algorithm.

Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation. However, when using large size ratios GJK can be imprecise so the distance is not conservative. In that case, enabling this USE_SEPDISTANCE_UTIL2 would result in failing/missing collisions. Either improve GJK for large size ratios (testing a 100 units versus a 0.1 unit object) or only enable the util for certain pairs that have a small size ratio The convexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations between two convex objects. Multiple contact points are calculated by perturbing the orientation of the smallest object orthogonal to the separating normal. This idea was described by Gino van den Bergen in this forum topic http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888

This was modified to leverage the Tesseract contact request to enable and disable different parts of the algorithm. The algorithm first does a quick binary check if the two objects are in collision. If in collision it runs the penetration algorithm to get the nearest points and penetration depths. If not in collision it runs the an algorithm to get the nearest points and distance. The Tesseract contact request allow you to now decide if you need all three. Example, in the case of OMPL if you have a contact distance of zero you can get a performance increase, by disabling the penetration and distance calculation because they add no value.

Note: This will not be able to be removed.

Constructor & Destructor Documentation

◆ TesseractConvexConvexAlgorithm() [1/3]

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::TesseractConvexConvexAlgorithm ( btPersistentManifold *  mf,
const btCollisionAlgorithmConstructionInfo &  ci,
const btCollisionObjectWrapper *  body0Wrap,
const btCollisionObjectWrapper *  body1Wrap,
btConvexPenetrationDepthSolver *  pdSolver,
int  numPerturbationIterations,
int  minimumPointsPerturbationThreshold 
)

cache separating vector to speedup collision detection

◆ ~TesseractConvexConvexAlgorithm()

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::~TesseractConvexConvexAlgorithm ( )
override

◆ TesseractConvexConvexAlgorithm() [2/3]

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::TesseractConvexConvexAlgorithm ( const TesseractConvexConvexAlgorithm )
delete

◆ TesseractConvexConvexAlgorithm() [3/3]

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::TesseractConvexConvexAlgorithm ( TesseractConvexConvexAlgorithm &&  )
delete

Member Function Documentation

◆ calculateTimeOfImpact()

btScalar tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::calculateTimeOfImpact ( btCollisionObject *  body0,
btCollisionObject *  body1,
const btDispatcherInfo &  dispatchInfo,
btManifoldResult *  resultOut 
)
override

Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold

Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold col0->m_worldTransform,

Convex0 against sphere for Convex1

Simplification, one object is simplified as a sphere

Sphere (for convex0) against Convex1

Simplification, one object is simplified as a sphere

◆ getAllContactManifolds()

void tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::getAllContactManifolds ( btManifoldArray &  manifoldArray)
inlineoverride

should we use m_ownManifold to avoid adding duplicates?

◆ getManifold()

const btPersistentManifold * tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::getManifold ( )
inline

◆ operator=() [1/2]

TesseractConvexConvexAlgorithm & tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::operator= ( const TesseractConvexConvexAlgorithm )
delete

◆ operator=() [2/2]

TesseractConvexConvexAlgorithm & tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::operator= ( TesseractConvexConvexAlgorithm &&  )
delete

◆ processCollision()

void tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::processCollision ( const btCollisionObjectWrapper *  body0Wrap,
const btCollisionObjectWrapper *  body1Wrap,
const btDispatcherInfo &  dispatchInfo,
btManifoldResult *  resultOut 
)
override

btBoxShape is an exception: its vertices are created WITH margin so don't subtract it

◆ setLowLevelOfDetail()

void tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::setLowLevelOfDetail ( bool  useLowLevel)

Member Data Documentation

◆ m_cdata

ContactTestData* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_cdata
private

◆ m_lowLevelOfDetail

bool tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_lowLevelOfDetail { false }
private

◆ m_manifoldPtr

btPersistentManifold* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_manifoldPtr
private

◆ m_minimumPointsPerturbationThreshold

int tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_minimumPointsPerturbationThreshold
private

◆ m_numPerturbationIterations

int tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_numPerturbationIterations
private

◆ m_ownManifold

bool tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_ownManifold { false }
private

◆ m_pdSolver

btConvexPenetrationDepthSolver* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_pdSolver
private

◆ worldVertsB1

btVertexArray tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::worldVertsB1
private

◆ worldVertsB2

btVertexArray tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::worldVertsB2
private

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