Simox  2.3.49
VirtualRobot::CollisionChecker Class Reference
Inheritance diagram for VirtualRobot::CollisionChecker:

Public Member Functions

 CollisionChecker ()
 
virtual ~CollisionChecker ()
 
virtual float calculateDistance (SceneObjectSetPtr model1, SceneObjectSetPtr model2)
 
virtual float calculateDistance (CollisionModelPtr model1, SceneObjectSetPtr model2)
 
virtual float calculateDistance (CollisionModelPtr model1, CollisionModelPtr model2)
 
virtual float calculateDistance (SceneObjectSetPtr model1, SceneObjectSetPtr model2, Eigen::Vector3f &P1, Eigen::Vector3f &P2, int *trID1=NULL, int *trID2=NULL)
 
virtual float calculateDistance (CollisionModelPtr model1, SceneObjectSetPtr model2, Eigen::Vector3f &P1, Eigen::Vector3f &P2, int *trID1=NULL, int *trID2=NULL)
 
virtual float calculateDistance (CollisionModelPtr model1, CollisionModelPtr model2, Eigen::Vector3f &P1, Eigen::Vector3f &P2, int *trID1=NULL, int *trID2=NULL)
 
virtual bool checkCollision (SceneObjectSetPtr model1, SceneObjectSetPtr model2)
 
virtual bool checkCollision (std::vector< CollisionModelPtr > &model1, CollisionModelPtr model2)
 
virtual bool checkCollision (CollisionModelPtr model1, SceneObjectSetPtr model2)
 
virtual bool checkCollision (CollisionModelPtr model1, CollisionModelPtr model2)
 
virtual void getContacts (const MathTools::Plane &p, CollisionModelPtr colModel, std::vector< MathTools::ContactPoint > &storeContatcs, float maxDist=1.0f)
 
bool isInitialized ()
 
void setAutomaticSizeCheck (bool checkSizeOnColModelCreation)
 
void enableDebugOutput (bool e)
 
virtual float calculateDistance (SceneObjectPtr model1, SceneObjectSetPtr model2)
 
virtual float calculateDistance (SceneObjectPtr model1, SceneObjectPtr model2)
 
virtual float calculateDistance (SceneObjectPtr model1, SceneObjectSetPtr model2, Eigen::Vector3f &P1, Eigen::Vector3f &P2, int *trID1=NULL, int *trID2=NULL)
 
virtual float calculateDistance (SceneObjectPtr model1, SceneObjectPtr model2, Eigen::Vector3f &P1, Eigen::Vector3f &P2, int *trID1=NULL, int *trID2=NULL)
 
virtual bool checkCollision (SceneObjectPtr model1, SceneObjectSetPtr model2)
 
virtual bool checkCollision (SceneObjectPtr model1, SceneObjectPtr model2)
 
boost::shared_ptr< CollisionCheckerPQPgetCollisionCheckerImplementation ()
 

Static Public Member Functions

static CollisionCheckerPtr getGlobalCollisionChecker ()
 This is the global collision checker singleton. More...
 
static bool IsSupported_CollisionDetection ()
 
static bool IsSupported_ContinuousCollisionDetection ()
 
static bool IsSupported_DistanceCalculations ()
 
static bool IsSupported_Multithreading_Threadsafe ()
 
static bool IsSupported_Multithreading_MultipleColCheckers ()
 

Data Fields

bool debugOutput
 

Protected Member Functions

SceneObjectSetPtr getRobotModels (RobotPtr r)
 

Friends

class Cleanup
 

Detailed Description

A CollisionChecker is an instance that handles collision and distance queries. Internally the requests are passed to the underlying engine (e.g. the PQP library). All objects that should be considered for collision detection (called CollisionModels) must be registered here. Usually the objects take care of registering on their own.

When collision detection should not be performed in parallel, the global CollisionChecker singleton can be used. It can be retrieved with CollisionChecker::getGlobalCollisionChecker().

Constructor & Destructor Documentation

VirtualRobot::CollisionChecker::CollisionChecker ( )
VirtualRobot::CollisionChecker::~CollisionChecker ( )
virtual

Member Function Documentation

float VirtualRobot::CollisionChecker::calculateDistance ( SceneObjectSetPtr  model1,
SceneObjectSetPtr  model2 
)
virtual

Returns distance of the collision models. Returns -1.0 if no distance calculation lib was specified (-> Dummy Col Checker)

float VirtualRobot::CollisionChecker::calculateDistance ( CollisionModelPtr  model1,
SceneObjectSetPtr  model2 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( CollisionModelPtr  model1,
CollisionModelPtr  model2 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( SceneObjectSetPtr  model1,
SceneObjectSetPtr  model2,
Eigen::Vector3f &  P1,
Eigen::Vector3f &  P2,
int *  trID1 = NULL,
int *  trID2 = NULL 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( CollisionModelPtr  model1,
SceneObjectSetPtr  model2,
Eigen::Vector3f &  P1,
Eigen::Vector3f &  P2,
int *  trID1 = NULL,
int *  trID2 = NULL 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( CollisionModelPtr  model1,
CollisionModelPtr  model2,
Eigen::Vector3f &  P1,
Eigen::Vector3f &  P2,
int *  trID1 = NULL,
int *  trID2 = NULL 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( SceneObjectPtr  model1,
SceneObjectSetPtr  model2 
)
virtual

Convenient methods

float VirtualRobot::CollisionChecker::calculateDistance ( SceneObjectPtr  model1,
SceneObjectPtr  model2 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( SceneObjectPtr  model1,
SceneObjectSetPtr  model2,
Eigen::Vector3f &  P1,
Eigen::Vector3f &  P2,
int *  trID1 = NULL,
int *  trID2 = NULL 
)
virtual
float VirtualRobot::CollisionChecker::calculateDistance ( SceneObjectPtr  model1,
SceneObjectPtr  model2,
Eigen::Vector3f &  P1,
Eigen::Vector3f &  P2,
int *  trID1 = NULL,
int *  trID2 = NULL 
)
virtual
bool VirtualRobot::CollisionChecker::checkCollision ( SceneObjectSetPtr  model1,
SceneObjectSetPtr  model2 
)
virtual

Test if the two models are colliding. Returns true on collision.

bool VirtualRobot::CollisionChecker::checkCollision ( std::vector< CollisionModelPtr > &  model1,
CollisionModelPtr  model2 
)
virtual

Test if the two models are colliding. Returns true on collision.

bool VirtualRobot::CollisionChecker::checkCollision ( CollisionModelPtr  model1,
SceneObjectSetPtr  model2 
)
virtual

Test if the two models are colliding. Returns true on collision.

bool VirtualRobot::CollisionChecker::checkCollision ( CollisionModelPtr  model1,
CollisionModelPtr  model2 
)
virtual

Test if the two models are colliding. Returns true on collision.

bool VirtualRobot::CollisionChecker::checkCollision ( SceneObjectPtr  model1,
SceneObjectSetPtr  model2 
)
virtual

Test if the two models are colliding. Returns true on collision.

bool VirtualRobot::CollisionChecker::checkCollision ( SceneObjectPtr  model1,
SceneObjectPtr  model2 
)
virtual

Test if the two models are colliding. Returns true on collision.

void VirtualRobot::CollisionChecker::enableDebugOutput ( bool  e)
inline
boost::shared_ptr<CollisionCheckerPQP> VirtualRobot::CollisionChecker::getCollisionCheckerImplementation ( )
inline
void VirtualRobot::CollisionChecker::getContacts ( const MathTools::Plane p,
CollisionModelPtr  colModel,
std::vector< MathTools::ContactPoint > &  storeContatcs,
float  maxDist = 1.0f 
)
virtual

Store all vertices of colModel whose distance to p is smaller than maxDist.

CollisionCheckerPtr VirtualRobot::CollisionChecker::getGlobalCollisionChecker ( )
static

This is the global collision checker singleton.

SceneObjectSetPtr VirtualRobot::CollisionChecker::getRobotModels ( RobotPtr  r)
protected
bool VirtualRobot::CollisionChecker::isInitialized ( )
inline

If continuous collision detection (CCD) is supported, this method can be used to detect collisions on the path from the current pose of the collision models to the goal poses. true -> collision (then the time of contact [0..1] is stored to fStoreTOC)

bool VirtualRobot::CollisionChecker::IsSupported_CollisionDetection ( )
static

Does the underlying collision detection library support discrete collision detection.

bool VirtualRobot::CollisionChecker::IsSupported_ContinuousCollisionDetection ( )
static

Does the underlying collision detection library support continuous collision detection.

bool VirtualRobot::CollisionChecker::IsSupported_DistanceCalculations ( )
static

Does the underlying collision detection library support distance calculations.

bool VirtualRobot::CollisionChecker::IsSupported_Multithreading_MultipleColCheckers ( )
static

Does the underlying collision detection library support multiple instances of the collision checker. E.g. one per thread.

bool VirtualRobot::CollisionChecker::IsSupported_Multithreading_Threadsafe ( )
static

Does the underlying collision detection library support threadsafe access. E.g. multiple threads query the collision checker asynchronously.

void VirtualRobot::CollisionChecker::setAutomaticSizeCheck ( bool  checkSizeOnColModelCreation)

Activates / Deactivates the automatic size check on col model creation. The size check can be useful when the UNITS definitions in inventor files result in different scalings of the 3D models. (Standard: true)

Friends And Related Function Documentation

friend class Cleanup
friend

Field Documentation

bool VirtualRobot::CollisionChecker::debugOutput