dart
|
Public Types | |
enum | PrimitiveShape { PRIMITIVE = 0, MESH } |
Whether to use analytic collision checking for primitive shapes. More... | |
enum | ContactPointComputationMethod { FCL = 0, DART } |
Whether to use FCL's contact point computation. More... | |
![]() | |
using | Factory = common::Factory< std::string, CollisionDetector, std::shared_ptr< CollisionDetector > > |
using | SingletonFactory = common::Singleton< Factory > |
template<typename Derived > | |
using | Registrar = common::FactoryRegistrar< std::string, CollisionDetector, Derived, std::shared_ptr< CollisionDetector > > |
Public Member Functions | |
virtual | ~FCLCollisionDetector () |
Constructor. | |
std::shared_ptr< CollisionDetector > | cloneWithoutCollisionObjects () const override |
Create a clone of this CollisionDetector. More... | |
const std::string & | getType () const override |
Return collision detection engine type as a std::string. | |
std::unique_ptr< CollisionGroup > | createCollisionGroup () override |
Create a collision group. | |
bool | collide (CollisionGroup *group, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr) override |
Perform collision check for a single group. More... | |
bool | collide (CollisionGroup *group1, CollisionGroup *group2, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr) override |
Perform collision check for two groups. More... | |
double | distance (CollisionGroup *group, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr) override |
Get the minimum signed distance between the Shape pairs in the given CollisionGroup. More... | |
double | distance (CollisionGroup *group1, CollisionGroup *group2, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr) override |
Get the minimum signed distance between the Shape pairs where a pair consist of two shapes from each groups (one from group1 and one from group2). More... | |
void | setPrimitiveShapeType (PrimitiveShape type) |
Set primitive shape type. | |
PrimitiveShape | getPrimitiveShapeType () const |
Get primitive shape type. | |
void | setContactPointComputationMethod (ContactPointComputationMethod method) |
Set contact point computation method. | |
ContactPointComputationMethod | getContactPointComputationMethod () const |
Get contact point computation method. | |
![]() | |
virtual | ~CollisionDetector ()=default |
Destructor. | |
std::shared_ptr< CollisionGroup > | createCollisionGroupAsSharedPtr () |
Helper function that creates and returns CollisionGroup as a shared_ptr. More... | |
template<typename... Args> | |
std::unique_ptr< CollisionGroup > | createCollisionGroup (const Args &... args) |
Create a collision group from any objects that are supported by CollisionGroup::addShapeFramesOf(). More... | |
template<typename... Args> | |
std::shared_ptr< CollisionGroup > | createCollisionGroupAsSharedPtr (const Args &... args) |
Helper function that creates and returns CollisionGroup as shared_ptr. | |
virtual bool | raycast (CollisionGroup *group, const Eigen::Vector3d &from, const Eigen::Vector3d &to, const RaycastOption &option=RaycastOption(), RaycastResult *result=nullptr) |
Performs raycast to a collision group. More... | |
Static Public Member Functions | |
static std::shared_ptr< FCLCollisionDetector > | create () |
static const std::string & | getStaticType () |
Get collision detector type for this class. | |
![]() | |
static Factory * | getFactory () |
Returns the singleton factory. | |
Protected Member Functions | |
FCLCollisionDetector () | |
Constructor. | |
std::unique_ptr< CollisionObject > | createCollisionObject (const dynamics::ShapeFrame *shapeFrame) override |
Create CollisionObject. | |
void | refreshCollisionObject (CollisionObject *object) override |
Update the collision geometry of a ShapeFrame. | |
std::shared_ptr< dart::collision::fcl::CollisionGeometry > | claimFCLCollisionGeometry (const dynamics::ConstShapePtr &shape) |
Return fcl::CollisionGeometry associated with give Shape. More... | |
![]() | |
CollisionDetector ()=default | |
Constructor. | |
std::shared_ptr< CollisionObject > | claimCollisionObject (const dynamics::ShapeFrame *shapeFrame) |
Claim CollisionObject associated with shapeFrame. More... | |
virtual void | notifyCollisionObjectDestroying (CollisionObject *object) |
Notify that a CollisionObject is destroying. Do nothing by default. | |
Protected Attributes | |
PrimitiveShape | mPrimitiveShapeType |
ContactPointComputationMethod | mContactPointComputationMethod |
![]() | |
std::unique_ptr< CollisionObjectManager > | mCollisionObjectManager |
Whether to use FCL's contact point computation.
FCL: Use FCL's contact point computation. DART: Use DART's own contact point computation
Warning: FCL's contact computation is not correct. See: https://github.com/flexible-collision-library/fcl/issues/106 We recommend using DART until it's fixed in FCL.
Whether to use analytic collision checking for primitive shapes.
PRIMITIVE: Use FCL's analytic collision checking for primitive shapes. MESH: Don't use it. Instead, use approximate mesh shapes for the primitive shapes. The contact result is probably less accurate than the analytic result.
Warning: FCL's primitive shape support is not complete. FCL 0.4.0 improved the support alot, but it still returns single contact point for a shape pair except for box-box collision. For this reason, we recommend using MESH until FCL fully supports primitive shapes.
|
protected |
Return fcl::CollisionGeometry associated with give Shape.
New fcl::CollisionGeome will be created if it hasn't created yet.
|
overridevirtual |
Create a clone of this CollisionDetector.
All the properties will be copied over, but not collision objects.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
Perform collision check for a single group.
If nullptr is passed to result, then the this returns only simple information whether there is a collision of not.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
Perform collision check for two groups.
If nullptr is passed to result, then the this returns only simple information whether there is a collision of not.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
Get the minimum signed distance between the Shape pairs in the given CollisionGroup.
The detailed results are stored in the given DistanceResult if provided.
The results can be different by DistanceOption. By default, non-negative minimum distance (distance >= 0) is returned for all the shape pairs without computing nearest points.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
Get the minimum signed distance between the Shape pairs where a pair consist of two shapes from each groups (one from group1 and one from group2).
Note that the distance between shapes within the same CollisionGroup are not accounted.
The detailed results are stored in the given DistanceResult if provided.
The results can be different by DistanceOption. By default, non-negative minimum distance (distance >= 0) is returned for all the shape pairs without computing nearest points.
Implements dart::collision::CollisionDetector.