Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
discrete_contact_manager.h
Go to the documentation of this file.
1
28#ifndef TESSERACT_COLLISION_DISCRETE_CONTACT_MANAGER_H
29#define TESSERACT_COLLISION_DISCRETE_CONTACT_MANAGER_H
30
33#include <memory>
35
37
38namespace tesseract_collision
39{
41{
42public:
43 // LCOV_EXCL_START
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 // LCOV_EXCL_STOP
46
47 using Ptr = std::shared_ptr<DiscreteContactManager>;
48 using ConstPtr = std::shared_ptr<const DiscreteContactManager>;
49 using UPtr = std::unique_ptr<DiscreteContactManager>;
50 using ConstUPtr = std::unique_ptr<const DiscreteContactManager>;
51
53 virtual ~DiscreteContactManager() = default;
58
63 virtual std::string getName() const = 0;
64
72
81 virtual bool addCollisionObject(const std::string& name,
82 const int& mask_id,
83 const CollisionShapesConst& shapes,
84 const tesseract_common::VectorIsometry3d& shape_poses,
85 bool enabled = true) = 0;
86
92 virtual const CollisionShapesConst& getCollisionObjectGeometries(const std::string& name) const = 0;
93
100 getCollisionObjectGeometriesTransforms(const std::string& name) const = 0;
101
107 virtual bool hasCollisionObject(const std::string& name) const = 0;
108
114 virtual bool removeCollisionObject(const std::string& name) = 0;
115
120 virtual bool enableCollisionObject(const std::string& name) = 0;
121
126 virtual bool disableCollisionObject(const std::string& name) = 0;
127
133 virtual bool isCollisionObjectEnabled(const std::string& name) const = 0;
134
140 virtual void setCollisionObjectsTransform(const std::string& name, const Eigen::Isometry3d& pose) = 0;
141
147 virtual void setCollisionObjectsTransform(const std::vector<std::string>& names,
148 const tesseract_common::VectorIsometry3d& poses) = 0;
149
155
160 virtual const std::vector<std::string>& getCollisionObjects() const = 0;
161
166 virtual void setActiveCollisionObjects(const std::vector<std::string>& names) = 0;
167
172 virtual const std::vector<std::string>& getActiveCollisionObjects() const = 0;
173
179 virtual void
181 CollisionMarginOverrideType override_type = CollisionMarginOverrideType::REPLACE) = 0;
182
187 virtual void setDefaultCollisionMarginData(double default_collision_margin) = 0;
188
199 virtual void setPairCollisionMarginData(const std::string& name1,
200 const std::string& name2,
201 double collision_margin) = 0;
202
207 virtual const CollisionMarginData& getCollisionMarginData() const = 0;
208
211
214
220 virtual void contactTest(ContactResultMap& collisions, const ContactRequest& request) = 0;
221
227};
228
229} // namespace tesseract_collision
230#endif // TESSERACT_COLLISION_DISCRETE_CONTACT_MANAGER_H
This structure hold contact results for link pairs.
Definition: types.h:154
Definition: discrete_contact_manager.h:41
virtual bool isCollisionObjectEnabled(const std::string &name) const =0
Check if collision object is enabled.
virtual void setIsContactAllowedFn(IsContactAllowedFn fn)=0
Set the active function for determining if two links are allowed to be in collision.
std::shared_ptr< DiscreteContactManager > Ptr
Definition: discrete_contact_manager.h:47
virtual void setActiveCollisionObjects(const std::vector< std::string > &names)=0
Set which collision objects can move.
virtual void contactTest(ContactResultMap &collisions, const ContactRequest &request)=0
Perform a contact test for all objects based.
virtual void setCollisionObjectsTransform(const std::string &name, const Eigen::Isometry3d &pose)=0
Set a single collision object's transforms.
virtual bool addCollisionObject(const std::string &name, const int &mask_id, const CollisionShapesConst &shapes, const tesseract_common::VectorIsometry3d &shape_poses, bool enabled=true)=0
Add a object to the checker.
virtual void applyContactManagerConfig(const ContactManagerConfig &config)
Applies settings in the config.
Definition: discrete_contact_manager.cpp:32
virtual std::string getName() const =0
Get the name of the contact manager.
virtual void setCollisionObjectsTransform(const std::vector< std::string > &names, const tesseract_common::VectorIsometry3d &poses)=0
Set a series of collision object's transforms.
DiscreteContactManager(const DiscreteContactManager &)=delete
std::unique_ptr< DiscreteContactManager > UPtr
Definition: discrete_contact_manager.h:49
DiscreteContactManager & operator=(const DiscreteContactManager &)=delete
virtual bool enableCollisionObject(const std::string &name)=0
Enable an object.
virtual void setPairCollisionMarginData(const std::string &name1, const std::string &name2, double collision_margin)=0
Set the margin for a given contact pair.
std::shared_ptr< const DiscreteContactManager > ConstPtr
Definition: discrete_contact_manager.h:48
virtual bool removeCollisionObject(const std::string &name)=0
Remove an object from the checker.
virtual const std::vector< std::string > & getCollisionObjects() const =0
Get all collision objects.
virtual void setDefaultCollisionMarginData(double default_collision_margin)=0
Set the default collision margin.
virtual bool hasCollisionObject(const std::string &name) const =0
Find if a collision object already exists.
virtual const tesseract_common::VectorIsometry3d & getCollisionObjectGeometriesTransforms(const std::string &name) const =0
Get a collision objects collision geometries transforms.
virtual bool disableCollisionObject(const std::string &name)=0
Disable an object.
DiscreteContactManager & operator=(DiscreteContactManager &&)=delete
DiscreteContactManager(DiscreteContactManager &&)=delete
virtual DiscreteContactManager::UPtr clone() const =0
Clone the manager.
virtual const std::vector< std::string > & getActiveCollisionObjects() const =0
Get which collision objects can move.
virtual const CollisionMarginData & getCollisionMarginData() const =0
Get the contact distance threshold.
virtual void setCollisionMarginData(CollisionMarginData collision_margin_data, CollisionMarginOverrideType override_type=CollisionMarginOverrideType::REPLACE)=0
Set the contact distance thresholds for which collision should be considered on a per pair basis.
virtual IsContactAllowedFn getIsContactAllowedFn() const =0
Get the active function for determining if two links are allowed to be in collision.
virtual void setCollisionObjectsTransform(const tesseract_common::TransformMap &transforms)=0
Set a series of collision object's transforms.
virtual const CollisionShapesConst & getCollisionObjectGeometries(const std::string &name) const =0
Get a collision objects collision geometries.
std::unique_ptr< const DiscreteContactManager > ConstUPtr
Definition: discrete_contact_manager.h:50
Stores information about how the margins allowed between collision objects.
Definition: collision_margin_data.h:74
tesseract_collision::CollisionCheckConfig config(5, request, tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE, 0.5)
Definition: tesseract_common_serialization_unit.cpp:154
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: bullet_cast_bvh_manager.h:49
std::vector< tesseract_geometry::Geometry::ConstPtr > CollisionShapesConst
Definition: types.h:47
std::function< bool(const std::string &, const std::string &)> IsContactAllowedFn
Should return true if contact allowed, otherwise false.
Definition: types.h:59
AlignedMap< std::string, Eigen::Isometry3d > TransformMap
Definition: types.h:66
AlignedVector< Eigen::Isometry3d > VectorIsometry3d
Definition: types.h:62
CollisionMarginOverrideType
Identifies how the provided contact margin data should be applied.
Definition: collision_margin_data.h:46
Contains parameters used to configure a contact manager before a series of contact checks.
Definition: types.h:394
The ContactRequest struct.
Definition: types.h:294
Tesseracts Collision Common Types.
auto pose
Definition: tesseract_environment_collision.cpp:118