bullet_bvh_manager.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD-2-Clause)
3  *
4  * Copyright (c) 2017, Southwest Research Institute
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *********************************************************************/
31 
32 /* Authors: Levi Armstrong, Jens Petit */
33 
34 #pragma once
35 
38 
40 {
41 MOVEIT_CLASS_FORWARD(BulletBVHManager);
42 
44 class BulletBVHManager
45 {
46 public:
47  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48 
51 
52  virtual ~BulletBVHManager();
53 
57  BulletBVHManagerPtr clone() const;
58 
62  bool hasCollisionObject(const std::string& name) const;
63 
67  bool removeCollisionObject(const std::string& name);
68 
72  bool enableCollisionObject(const std::string& name);
73 
77  bool disableCollisionObject(const std::string& name);
78 
82  void setCollisionObjectsTransform(const std::string& name, const Eigen::Isometry3d& pose);
83 
86  void setActiveCollisionObjects(const std::vector<std::string>& names);
87 
90  const std::vector<std::string>& getActiveCollisionObjects() const;
91 
96  void setContactDistanceThreshold(double contact_distance);
97 
100  double getContactDistanceThreshold() const;
101 
107  virtual void contactTest(collision_detection::CollisionResult& collisions,
109  const collision_detection::AllowedCollisionMatrix* acm, bool self) = 0;
110 
116  virtual void addCollisionObject(const CollisionObjectWrapperPtr& cow) = 0;
117 
118  const std::map<std::string, CollisionObjectWrapperPtr>& getCollisionObjects() const;
119 
120 protected:
122  std::map<std::string, CollisionObjectWrapperPtr> link2cow_;
123 
125  std::vector<std::string> active_;
126 
128  double contact_distance_;
129 
131  std::unique_ptr<btCollisionDispatcher> dispatcher_;
132 
134  btDispatcherInfo dispatch_info_;
135 
137  btDefaultCollisionConfiguration coll_config_;
138 
140  std::unique_ptr<btBroadphaseInterface> broadphase_;
141 
144 };
145 } // namespace collision_detection_bullet
collision_detection_bullet
Definition: basic_types.h:34
collision_detection_bullet::BulletBVHManager::setCollisionObjectsTransform
void setCollisionObjectsTransform(const std::string &name, const Eigen::Isometry3d &pose)
Set a single static collision object's tansform.
Definition: bullet_bvh_manager.cpp:137
collision_detection_bullet::BulletBVHManager::BulletBVHManager
EIGEN_MAKE_ALIGNED_OPERATOR_NEW BulletBVHManager()
Constructor.
Definition: bullet_bvh_manager.cpp:69
collision_detection_bullet::BulletBVHManager::dispatcher_
std::unique_ptr< btCollisionDispatcher > dispatcher_
The bullet collision dispatcher used for getting object to object collison algorithm.
Definition: bullet_bvh_manager.h:160
collision_detection_bullet::BulletBVHManager::broadphase_
std::unique_ptr< btBroadphaseInterface > broadphase_
The bullet broadphase interface.
Definition: bullet_bvh_manager.h:169
collision_detection_bullet::BroadphaseFilterCallback
Definition: bullet_utils.h:962
collision_detection_bullet::BulletBVHManager::~BulletBVHManager
virtual ~BulletBVHManager()
Definition: bullet_bvh_manager.cpp:87
class_forward.h
collision_detection_bullet::BulletBVHManager::active_
std::vector< std::string > active_
A list of the active collision links.
Definition: bullet_bvh_manager.h:154
collision_detection_bullet::BulletBVHManager::disableCollisionObject
bool disableCollisionObject(const std::string &name)
Disable an object.
Definition: bullet_bvh_manager.cpp:125
collision_detection_bullet::BulletBVHManager::hasCollisionObject
bool hasCollisionObject(const std::string &name) const
Find if a collision object already exists.
Definition: bullet_bvh_manager.cpp:94
collision_detection::CollisionRequest
Representation of a collision checking request.
Definition: include/moveit/collision_detection/collision_common.h:179
collision_detection_bullet::BulletBVHManager::setActiveCollisionObjects
void setActiveCollisionObjects(const std::vector< std::string > &names)
Set which collision objects are active.
Definition: bullet_bvh_manager.cpp:153
collision_detection::AllowedCollisionMatrix
Definition of a structure for the allowed collision matrix.
Definition: collision_matrix.h:112
collision_detection_bullet::BulletBVHManager::coll_config_
btDefaultCollisionConfiguration coll_config_
The bullet collision configuration.
Definition: bullet_bvh_manager.h:166
collision_detection::CollisionResult
Representation of a collision checking result.
Definition: include/moveit/collision_detection/collision_common.h:382
bullet_utils.h
collision_detection_bullet::BulletBVHManager::link2cow_
std::map< std::string, CollisionObjectWrapperPtr > link2cow_
A map of collision objects being managed.
Definition: bullet_bvh_manager.h:151
collision_detection_bullet::BulletBVHManager::getActiveCollisionObjects
const std::vector< std::string > & getActiveCollisionObjects() const
Get which collision objects are active.
Definition: bullet_bvh_manager.cpp:169
collision_detection_bullet::BulletBVHManager::addCollisionObject
virtual void addCollisionObject(const CollisionObjectWrapperPtr &cow)=0
Add a collision object to the checker.
collision_detection_bullet::BulletBVHManager::getContactDistanceThreshold
double getContactDistanceThreshold() const
Get the contact distance threshold.
Definition: bullet_bvh_manager.cpp:187
collision_detection_bullet::BulletBVHManager::clone
BulletBVHManagerPtr clone() const
Clone the manager.
collision_detection_bullet::BulletBVHManager::getCollisionObjects
const std::map< std::string, CollisionObjectWrapperPtr > & getCollisionObjects() const
Definition: bullet_bvh_manager.cpp:192
collision_detection_bullet::BulletBVHManager::dispatch_info_
btDispatcherInfo dispatch_info_
The bullet collision dispatcher configuration information.
Definition: bullet_bvh_manager.h:163
collision_detection_bullet::BulletBVHManager::removeCollisionObject
bool removeCollisionObject(const std::string &name)
Remove an object from the checker.
Definition: bullet_bvh_manager.cpp:99
collision_detection_bullet::BulletBVHManager::enableCollisionObject
bool enableCollisionObject(const std::string &name)
Enable an object.
Definition: bullet_bvh_manager.cpp:113
collision_detection_bullet::BulletBVHManager::contact_distance_
double contact_distance_
The contact distance threshold.
Definition: bullet_bvh_manager.h:157
collision_detection_bullet::MOVEIT_CLASS_FORWARD
MOVEIT_CLASS_FORWARD(BulletBVHManager)
collision_detection_bullet::BulletBVHManager::filter_callback_
BroadphaseFilterCallback filter_callback_
Callback function for culling objects before a broadphase check.
Definition: bullet_bvh_manager.h:172
collision_detection_bullet::BulletBVHManager::contactTest
virtual void contactTest(collision_detection::CollisionResult &collisions, const collision_detection::CollisionRequest &req, const collision_detection::AllowedCollisionMatrix *acm, bool self)=0
Perform a contact test for all objects.
collision_detection_bullet::BulletBVHManager::setContactDistanceThreshold
void setContactDistanceThreshold(double contact_distance)
Set the contact distance threshold for which collision should be considered through expanding the AAB...
Definition: bullet_bvh_manager.cpp:174


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Sun Nov 3 2024 03:26:14