Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract::collision::bullet_internal::TesseractConvexConvexAlgorithm Class Reference

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

#include <tesseract_convex_convex_algorithm.h>

Inheritance diagram for tesseract::collision::bullet_internal::TesseractConvexConvexAlgorithm:

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
 TesseractConvexConvexAlgorithm (const TesseractConvexConvexAlgorithm &)=delete
TesseractConvexConvexAlgorithm & operator= (const TesseractConvexConvexAlgorithm &)=delete
 TesseractConvexConvexAlgorithm (TesseractConvexConvexAlgorithm &&)=delete
TesseractConvexConvexAlgorithm & operator= (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 ()

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.

Member Function Documentation

◆ processCollision()

void tesseract::collision::bullet_internal::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

◆ calculateTimeOfImpact()

btScalar tesseract::collision::bullet_internal::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::bullet_internal::TesseractConvexConvexAlgorithm::getAllContactManifolds ( btManifoldArray & manifoldArray)
inlineoverride

should we use m_ownManifold to avoid adding duplicates?