Parasol Planning Library (PPL)
CollisionDetection_UseCase.cpp

This is an example of how to use the collision detection methods.

void CollisionDetectionUseCase() {
// The GMSPolyhedron objects represent d-dimensional polyhedrons. Workspace
// obstacles and robots are represented as 3d polyhedrons.
GMSPolyhedron polyhedronA, polyhedronB;
// The Transformation objects represent movements of 3d objects in space.
mathtool::Transformation transformA, transformB;
// The collision detection info object will be used by the CD object to output
// additional information such as the clearance (distance from obstacles) of
// the configuration.
CDInfo cdInfo;
// The collision detection method object
// The IsInCollision function will return true if the polyhedrons are
// considered to be in collision after being subjected to the respective
// transformations. Less formally, the function checks if two objects
// will be in collision with each other after certain movements.
// Additional information will be stored in the CDInfo object cdInfo.
bool valid = cd->IsInCollision(polyhedronA, transformA,
polyhedronB, transformB, cdInfo);
// A point that we would like to check the validity of.
Point3D point;
// The IsInsideObstacle function will return true if the point is inside of
// the polyhedron.
bool isInside = cd->IsInsideObstacle(point, polyhedronA, transformA);
}
Definition: CollisionDetectionMethod.h:19
virtual bool IsInsideObstacle(const mathtool::Vector3d &_point, const GMSPolyhedron &_polyhedron, const mathtool::Transformation &_transformation)
Definition: CollisionDetectionMethod.cpp:33
virtual bool IsInCollision(const GMSPolyhedron &_polyhedron1, const mathtool::Transformation &_transformation1, const GMSPolyhedron &_polyhedron2, const mathtool::Transformation &_transformation2, CDInfo &_cdInfo)
Definition: CollisionDetectionMethod.cpp:40
Definition: GMSPolyhedron.h:42
Definition: CDInfo.h:139