33 #ifndef DART_COLLISION_COLLISIONDETECTOR_HPP_
34 #define DART_COLLISION_COLLISIONDETECTOR_HPP_
39 #include <Eigen/Dense>
66 std::shared_ptr<CollisionDetector>>;
70 template <
typename Derived>
75 std::shared_ptr<CollisionDetector>>;
89 virtual const std::string&
getType()
const = 0;
110 template <
typename... Args>
114 template <
typename... Args>
116 const Args&... args);
180 const Eigen::Vector3d& from,
181 const Eigen::Vector3d& to,
293 = std::map<const dynamics::ShapeFrame*, std::weak_ptr<CollisionObject>>;
const CollisionOption & option
Collision option of DART.
Definition: FCLCollisionDetector.cpp:157
CollisionResult * result
Collision result of DART.
Definition: FCLCollisionDetector.cpp:160
Definition: CollisionDetector.hpp:215
virtual std::shared_ptr< CollisionObject > claimCollisionObject(const dynamics::ShapeFrame *shapeFrame)=0
Claim CollisionObject associated with shapeFrame.
CollisionObjectManager(CollisionDetector *cd)
Constructor.
Definition: CollisionDetector.cpp:91
CollisionDetector * getCollisionDetector()
Returns collision detector.
Definition: CollisionDetector.cpp:100
CollisionDetector * mCollisionDetector
Definition: CollisionDetector.hpp:233
virtual ~CollisionObjectManager()=default
Virtual destructor.
Definition: CollisionDetector.hpp:266
CollisionObjectMap mCollisionObjectMap
Definition: CollisionDetector.hpp:295
ManagerForSharableCollisionObjects(CollisionDetector *cd)
Constructor.
Definition: CollisionDetector.cpp:146
std::shared_ptr< CollisionObject > claimCollisionObject(const dynamics::ShapeFrame *shapeFrame)
Claim CollisionObject associated with shapeFrame.
Definition: CollisionDetector.cpp:161
std::map< const dynamics::ShapeFrame *, std::weak_ptr< CollisionObject > > CollisionObjectMap
Definition: CollisionDetector.hpp:293
virtual ~ManagerForSharableCollisionObjects()
Destructor.
Definition: CollisionDetector.cpp:154
const CollisionObjectDeleter mCollisionObjectDeleter
Definition: CollisionDetector.hpp:290
Definition: CollisionDetector.hpp:239
ManagerForUnsharableCollisionObjects(CollisionDetector *cd)
Constructor.
Definition: CollisionDetector.cpp:107
std::shared_ptr< CollisionObject > claimCollisionObject(const dynamics::ShapeFrame *shapeFrame)
Claim CollisionObject associated with shapeFrame.
Definition: CollisionDetector.cpp:115
const CollisionObjectDeleter mCollisionObjectDeleter
Definition: CollisionDetector.hpp:260
Definition: CollisionDetector.hpp:58
virtual double distance(CollisionGroup *group, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr)=0
Get the minimum signed distance between the Shape pairs in the given CollisionGroup.
CollisionDetector()=default
Constructor.
std::shared_ptr< CollisionObject > claimCollisionObject(const dynamics::ShapeFrame *shapeFrame)
Claim CollisionObject associated with shapeFrame.
Definition: CollisionDetector.cpp:73
virtual void notifyCollisionObjectDestroying(CollisionObject *object)
Notify that a CollisionObject is destroying. Do nothing by default.
Definition: CollisionDetector.cpp:84
virtual bool collide(CollisionGroup *group, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr)=0
Perform collision check for a single group.
virtual std::unique_ptr< CollisionObject > createCollisionObject(const dynamics::ShapeFrame *shapeFrame)=0
Create CollisionObject.
std::shared_ptr< CollisionGroup > createCollisionGroupAsSharedPtr()
Helper function that creates and returns CollisionGroup as a shared_ptr.
Definition: CollisionDetector.cpp:54
virtual const std::string & getType() const =0
Return collision detection engine type as a std::string.
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.
Definition: CollisionDetector.cpp:60
static Factory * getFactory()
Returns the singleton factory.
Definition: CollisionDetector.cpp:47
virtual ~CollisionDetector()=default
Destructor.
virtual std::shared_ptr< CollisionDetector > cloneWithoutCollisionObjects() const =0
Create a clone of this CollisionDetector.
virtual void refreshCollisionObject(CollisionObject *object)=0
Update the collision geometry of a ShapeFrame.
virtual bool collide(CollisionGroup *group1, CollisionGroup *group2, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr)=0
Perform collision check for two groups.
std::unique_ptr< CollisionObjectManager > mCollisionObjectManager
Definition: CollisionDetector.hpp:210
virtual std::unique_ptr< CollisionGroup > createCollisionGroup()=0
Create a collision group.
virtual double distance(CollisionGroup *group1, CollisionGroup *group2, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr)=0
Get the minimum signed distance between the Shape pairs where a pair consist of two shapes from each ...
Definition: CollisionGroup.hpp:53
Definition: CollisionObject.hpp:45
Definition: CollisionResult.hpp:52
Helper class to register a object creator function to the Singleton.
Definition: Factory.hpp:125
Implementation of the Abstract Factory Pattern.
Definition: Factory.hpp:63
Singleton template class.
Definition: Singleton.hpp:51
Definition: ShapeFrame.hpp:192
::fcl::CollisionObject CollisionObject
Definition: BackwardCompatibility.hpp:161
Definition: BulletCollisionDetector.cpp:65
This deleter is responsible for deleting CollisionObject and removing it from mCollisionObjectMap whe...
Definition: CollisionDetector.hpp:282
void operator()(CollisionObject *object) const
Definition: CollisionDetector.cpp:195
ManagerForSharableCollisionObjects * mCollisionObjectManager
Definition: CollisionDetector.hpp:283
CollisionObjectDeleter(ManagerForSharableCollisionObjects *mgr)
Definition: CollisionDetector.cpp:187
This deleter is responsible for deleting CollisionObject and removing it from mCollisionObjectMap whe...
Definition: CollisionDetector.hpp:252
CollisionObjectDeleter(ManagerForUnsharableCollisionObjects *mgr)
Definition: CollisionDetector.cpp:127
ManagerForUnsharableCollisionObjects * mCollisionObjectManager
Definition: CollisionDetector.hpp:253
void operator()(CollisionObject *object) const
Definition: CollisionDetector.cpp:136
Definition: CollisionOption.hpp:45
Definition: DistanceOption.hpp:45
Definition: DistanceResult.hpp:47
Definition: RaycastOption.hpp:43
Definition: RaycastResult.hpp:63