bullet_cast_bvh_manager.cpp
Go to the documentation of this file.
1 
44 
45 extern btScalar gDbvtMargin; // NOLINT
46 
48 {
51 
53  : name_(std::move(name)), config_info_(std::move(config_info)), coll_config_(config_info_)
54 {
55  // Bullet adds a margin of 5cm to which is an extern variable, so we set it to zero.
56  gDbvtMargin = 0;
57 
58  dispatcher_ = std::make_unique<btCollisionDispatcher>(&coll_config_);
59 
60  dispatcher_->registerCollisionCreateFunc(
61  BOX_SHAPE_PROXYTYPE,
62  BOX_SHAPE_PROXYTYPE,
63  coll_config_.getCollisionAlgorithmCreateFunc(CONVEX_SHAPE_PROXYTYPE, CONVEX_SHAPE_PROXYTYPE));
64 
65  dispatcher_->setDispatcherFlags(dispatcher_->getDispatcherFlags() &
66  ~btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD);
67 
68  broadphase_ = std::make_unique<btDbvtBroadphase>();
69  broadphase_->getOverlappingPairCache()->setOverlapFilterCallback(&broadphase_overlap_cb_);
70 
72 }
73 
75 {
76  // clean up remaining objects
77  for (auto& co : link2cow_)
79 
80  // clean up remaining objects
81  for (auto& co : link2castcow_)
83 }
84 
85 std::string BulletCastBVHManager::getName() const { return name_; }
86 
88 {
89  auto manager = std::make_unique<BulletCastBVHManager>(name_, config_info_.clone());
90 
91  auto margin = static_cast<btScalar>(contact_test_data_.collision_margin_data.getMaxCollisionMargin());
92 
93  for (const auto& cow : link2cow_)
94  {
95  COW::Ptr new_cow = cow.second->clone();
96 
97  assert(new_cow->getCollisionShape());
98  assert(new_cow->getCollisionShape()->getShapeType() != CUSTOM_CONVEX_SHAPE_TYPE);
99 
100  new_cow->setWorldTransform(cow.second->getWorldTransform());
101  new_cow->setContactProcessingThreshold(margin);
102 
103  manager->addCollisionObject(new_cow);
104  }
105 
106  manager->setActiveCollisionObjects(active_);
107  manager->setCollisionMarginData(contact_test_data_.collision_margin_data);
108  manager->setContactAllowedValidator(contact_test_data_.validator);
109 
110  return manager;
111 }
112 
113 bool BulletCastBVHManager::addCollisionObject(const std::string& name,
114  const int& mask_id,
115  const CollisionShapesConst& shapes,
116  const tesseract_common::VectorIsometry3d& shape_poses,
117  bool enabled)
118 {
119  if (link2cow_.find(name) != link2cow_.end())
121 
122  COW::Ptr new_cow = createCollisionObject(name, mask_id, shapes, shape_poses, enabled);
123  if (new_cow != nullptr)
124  {
125  auto margin = static_cast<btScalar>(contact_test_data_.collision_margin_data.getMaxCollisionMargin());
126  new_cow->setContactProcessingThreshold(margin);
127  addCollisionObject(new_cow);
128  return true;
129  }
130 
131  return false;
132 }
133 
135 {
136  auto cow = link2cow_.find(name);
137  return (link2cow_.find(name) != link2cow_.end()) ? cow->second->getCollisionGeometries() :
139 }
140 
143 {
144  auto cow = link2cow_.find(name);
145  return (link2cow_.find(name) != link2cow_.end()) ? cow->second->getCollisionGeometriesTransforms() :
147 }
148 
149 bool BulletCastBVHManager::hasCollisionObject(const std::string& name) const
150 {
151  return (link2cow_.find(name) != link2cow_.end());
152 }
153 
154 bool BulletCastBVHManager::removeCollisionObject(const std::string& name)
155 {
156  auto it = link2cow_.find(name);
157  if (it != link2cow_.end())
158  {
159  COW::Ptr& cow1 = it->second;
160  collision_objects_.erase(std::find(collision_objects_.begin(), collision_objects_.end(), name));
162  link2cow_.erase(name);
163 
164  COW::Ptr& cow2 = link2castcow_[name];
166  link2castcow_.erase(name);
167 
168  return true;
169  }
170 
171  return false;
172 }
173 
174 bool BulletCastBVHManager::enableCollisionObject(const std::string& name)
175 {
176  auto it = link2cow_.find(name);
177  if (it != link2cow_.end())
178  {
179  it->second->m_enabled = true;
180 
181  // Need to clean the proxy from broadphase cache so BroadPhaseFilter gets called again.
182  // The BroadPhaseFilter only gets called once, so if you change when two objects can be in collision, like filters
183  // this must be called or contacts between shapes will be missed.
184  if (it->second->getBroadphaseHandle() != nullptr)
185  broadphase_->getOverlappingPairCache()->cleanProxyFromPairs(it->second->getBroadphaseHandle(), dispatcher_.get());
186 
187  auto cast_cow = link2castcow_[name];
188  cast_cow->m_enabled = true;
189 
190  // Need to clean the proxy from broadphase cache so BroadPhaseFilter gets called again.
191  // The BroadPhaseFilter only gets called once, so if you change when two objects can be in collision, like filters
192  // this must be called or contacts between shapes will be missed.
193  if (cast_cow->getBroadphaseHandle() != nullptr)
194  broadphase_->getOverlappingPairCache()->cleanProxyFromPairs(cast_cow->getBroadphaseHandle(), dispatcher_.get());
195 
196  return true;
197  }
198 
199  return false;
200 }
201 
202 bool BulletCastBVHManager::disableCollisionObject(const std::string& name)
203 {
204  auto it = link2cow_.find(name);
205  if (it != link2cow_.end())
206  {
207  it->second->m_enabled = false;
208 
209  // Need to clean the proxy from broadphase cache so BroadPhaseFilter gets called again.
210  // The BroadPhaseFilter only gets called once, so if you change when two objects can be in collision, like filters
211  // this must be called or contacts between shapes will be missed.
212  if (it->second->getBroadphaseHandle() != nullptr)
213  broadphase_->getOverlappingPairCache()->cleanProxyFromPairs(it->second->getBroadphaseHandle(), dispatcher_.get());
214 
215  auto cast_cow = link2castcow_[name];
216  cast_cow->m_enabled = false;
217 
218  // Need to clean the proxy from broadphase cache so BroadPhaseFilter gets called again.
219  // The BroadPhaseFilter only gets called once, so if you change when two objects can be in collision, like filters
220  // this must be called or contacts between shapes will be missed.
221  if (cast_cow->getBroadphaseHandle() != nullptr)
222  broadphase_->getOverlappingPairCache()->cleanProxyFromPairs(cast_cow->getBroadphaseHandle(), dispatcher_.get());
223 
224  return true;
225  }
226 
227  return false;
228 }
229 
230 bool BulletCastBVHManager::isCollisionObjectEnabled(const std::string& name) const
231 {
232  auto it = link2cow_.find(name);
233  if (it != link2cow_.end())
234  return it->second->m_enabled;
235 
236  return false;
237 }
238 
239 void BulletCastBVHManager::setCollisionObjectsTransform(const std::string& name, const Eigen::Isometry3d& pose)
240 {
241  // TODO: Find a way to remove this check. Need to store information in Tesseract EnvState indicating transforms with
242  // geometry
243  auto it = link2cow_.find(name);
244  if (it != link2cow_.end())
245  {
246  COW::Ptr& cow = it->second;
247  btTransform tf = convertEigenToBt(pose);
248  cow->setWorldTransform(tf);
249  link2castcow_[name]->setWorldTransform(tf);
250 
251  // Now update Broadphase AABB (See BulletWorld updateSingleAabb function)
252  if (cow->getBroadphaseHandle() != nullptr)
254  }
255 }
256 
257 void BulletCastBVHManager::setCollisionObjectsTransform(const std::vector<std::string>& names,
259 {
260  assert(names.size() == poses.size());
261  for (auto i = 0U; i < names.size(); ++i)
262  setCollisionObjectsTransform(names[i], poses[i]);
263 }
264 
266 {
267  for (const auto& transform : transforms)
269 }
270 
272  const Eigen::Isometry3d& pose1,
273  const Eigen::Isometry3d& pose2)
274 {
275  // TODO: Find a way to remove this check. Need to store information in Tesseract EnvState indicating transforms with
276  // geometry
277  auto it = link2castcow_.find(name);
278  if (it != link2castcow_.end())
279  {
280  COW::Ptr& cow = it->second;
281  assert(cow->m_collisionFilterGroup == btBroadphaseProxy::KinematicFilter);
282 
283  btTransform tf1 = convertEigenToBt(pose1);
284  btTransform tf2 = convertEigenToBt(pose2);
285 
286  cow->setWorldTransform(tf1);
287  link2cow_[name]->setWorldTransform(tf1);
288 
289  // If collision object is disabled dont proceed
290  if (cow->m_enabled)
291  {
292  if (btBroadphaseProxy::isConvex(cow->getCollisionShape()->getShapeType()))
293  {
294  assert(dynamic_cast<CastHullShape*>(cow->getCollisionShape()) != nullptr);
295  static_cast<CastHullShape*>(cow->getCollisionShape())->updateCastTransform(tf1.inverseTimes(tf2));
296  }
297  else if (btBroadphaseProxy::isCompound(cow->getCollisionShape()->getShapeType()))
298  {
299  assert(dynamic_cast<btCompoundShape*>(cow->getCollisionShape()) != nullptr);
300  auto* compound = static_cast<btCompoundShape*>(cow->getCollisionShape());
301  for (int i = 0; i < compound->getNumChildShapes(); ++i)
302  {
303  if (btBroadphaseProxy::isConvex(compound->getChildShape(i)->getShapeType()))
304  {
305  assert(dynamic_cast<CastHullShape*>(compound->getChildShape(i)) != nullptr);
306  const btTransform& local_tf = compound->getChildTransform(i);
307 
308  btTransform delta_tf = (tf1 * local_tf).inverseTimes(tf2 * local_tf);
309  static_cast<CastHullShape*>(compound->getChildShape(i))->updateCastTransform(delta_tf);
310  compound->updateChildTransform(i, local_tf, false); // This is required to update the BVH tree
311  }
312  else if (btBroadphaseProxy::isCompound(compound->getChildShape(i)->getShapeType()))
313  {
314  assert(dynamic_cast<btCompoundShape*>(compound->getChildShape(i)) != nullptr);
315  auto* second_compound = static_cast<btCompoundShape*>(compound->getChildShape(i));
316 
317  for (int j = 0; j < second_compound->getNumChildShapes(); ++j)
318  {
319  assert(!btBroadphaseProxy::isCompound(second_compound->getChildShape(j)->getShapeType()));
320  assert(dynamic_cast<CastHullShape*>(second_compound->getChildShape(j)) != nullptr);
321  const btTransform& local_tf = second_compound->getChildTransform(j);
322 
323  btTransform delta_tf = (tf1 * local_tf).inverseTimes(tf2 * local_tf);
324  static_cast<CastHullShape*>(second_compound->getChildShape(j))->updateCastTransform(delta_tf);
325  second_compound->updateChildTransform(j, local_tf, false); // This is required to update the BVH tree
326  }
327  second_compound->recalculateLocalAabb();
328  }
329  }
330  compound->recalculateLocalAabb();
331  }
332  else
333  {
334  throw std::runtime_error("I can only continuous collision check convex shapes and compound shapes made of "
335  "convex "
336  "shapes");
337  }
338 
339  // Now update Broadphase AABB (See BulletWorld updateSingleAabb function)
341  }
342  }
343 }
344 
345 void BulletCastBVHManager::setCollisionObjectsTransform(const std::vector<std::string>& names,
348 {
349  assert(names.size() == pose1.size());
350  assert(names.size() == pose2.size());
351  for (auto i = 0U; i < names.size(); ++i)
352  setCollisionObjectsTransform(names[i], pose1[i], pose2[i]);
353 }
354 
356  const tesseract_common::TransformMap& pose2)
357 {
358  assert(pose1.size() == pose2.size());
359  auto it1 = pose1.begin();
360  auto it2 = pose2.begin();
361  while (it1 != pose1.end())
362  {
363  assert(pose1.find(it1->first) != pose2.end());
364  setCollisionObjectsTransform(it1->first, it1->second, it2->second);
365  std::advance(it1, 1);
366  std::advance(it2, 1);
367  }
368 }
369 
370 const std::vector<std::string>& BulletCastBVHManager::getCollisionObjects() const { return collision_objects_; }
371 
372 void BulletCastBVHManager::setActiveCollisionObjects(const std::vector<std::string>& names)
373 {
374  active_ = names;
376 
377  // Now need to update the broadphase with correct aabb
378  for (auto& co : link2cow_)
379  {
380  COW::Ptr& cow = co.second;
381 
382  // Need to check if a collision object is still active
383  if (cow->m_collisionFilterGroup == btBroadphaseProxy::KinematicFilter)
384  {
385  // Update with active
387 
388  // Get the active collision object
389  COW::Ptr& active_cow = link2castcow_[cow->getName()];
390 
391  // Update with active
393 
394  // Check if the link is still active.
395  if (!isLinkActive(active_, cow->getName()))
396  {
397  // Remove the active collision object from the broadphase
399 
400  // Add the active collision object to the broadphase
402  }
403  }
404  else
405  {
406  // Update with active
408 
409  // Get the active collision object
410  COW::Ptr& active_cow = link2castcow_[cow->getName()];
411 
412  // Update with active
414 
415  // Check if link is now active
416  if (isLinkActive(active_, cow->getName()))
417  {
418  // Remove the static collision object from the broadphase
420 
421  // Add the active collision object to the broadphase
423  }
424  }
425  }
426 }
427 
428 const std::vector<std::string>& BulletCastBVHManager::getActiveCollisionObjects() const { return active_; }
429 
431 {
432  contact_test_data_.collision_margin_data = std::move(collision_margin_data);
434 }
435 
437 {
439 }
440 
442  CollisionMarginPairOverrideType override_type)
443 {
444  contact_test_data_.collision_margin_data.apply(pair_margin_data, override_type);
446 }
447 
448 void BulletCastBVHManager::setDefaultCollisionMargin(double default_collision_margin)
449 {
452 }
453 
455 {
458 }
459 
460 void BulletCastBVHManager::setCollisionMarginPair(const std::string& name1,
461  const std::string& name2,
462  double collision_margin)
463 {
464  contact_test_data_.collision_margin_data.setCollisionMargin(name1, name2, collision_margin);
466 }
467 
469  std::shared_ptr<const tesseract_common::ContactAllowedValidator> validator)
470 {
471  contact_test_data_.validator = std::move(validator);
472 }
473 std::shared_ptr<const tesseract_common::ContactAllowedValidator>
475 {
477 }
479 {
480  contact_test_data_.res = &collisions;
481  contact_test_data_.req = request;
482  contact_test_data_.done = false;
483 
484  broadphase_->calculateOverlappingPairs(dispatcher_.get());
485 
486  btOverlappingPairCache* pairCache = broadphase_->getOverlappingPairCache();
487 
490 
492 
493  pairCache->processAllOverlappingPairs(&collisionCallback, dispatcher_.get());
494 }
495 
497 {
498  cow->setUserPointer(&contact_test_data_);
499  link2cow_[cow->getName()] = cow;
500  collision_objects_.push_back(cow->getName());
501 
502  // Create cast collision object
503  COW::Ptr cast_cow = makeCastCollisionObject(cow);
504  cast_cow->setUserPointer(&contact_test_data_);
505 
506  // Add it to the cast map
507  link2castcow_[cast_cow->getName()] = cast_cow;
508 
509  const COW::Ptr& selected_cow = (cow->m_collisionFilterGroup == btBroadphaseProxy::KinematicFilter) ? cast_cow : cow;
510 
511  btVector3 aabb_min, aabb_max;
512  selected_cow->getAABB(aabb_min, aabb_max);
513 
514  int type = selected_cow->getCollisionShape()->getShapeType();
515  selected_cow->setBroadphaseHandle(broadphase_->createProxy(aabb_min,
516  aabb_max,
517  type,
518  selected_cow.get(),
519  selected_cow->m_collisionFilterGroup,
520  selected_cow->m_collisionFilterMask,
521  dispatcher_.get()));
522 }
523 
525 {
526  auto margin = static_cast<btScalar>(contact_test_data_.collision_margin_data.getMaxCollisionMargin());
527  for (auto& co : link2cow_)
528  {
529  COW::Ptr& cow = co.second;
530  cow->setContactProcessingThreshold(margin);
531  if (cow->getBroadphaseHandle() != nullptr)
533  }
534 
535  for (auto& co : link2castcow_)
536  {
537  COW::Ptr& cow = co.second;
538  cow->setContactProcessingThreshold(margin);
539  if (cow->getBroadphaseHandle() != nullptr)
541  }
542 }
543 
544 } // namespace tesseract_collision::tesseract_collision_bullet
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::removeCollisionObject
bool removeCollisionObject(const std::string &name) override final
Remove an object from the checker.
Definition: bullet_cast_bvh_manager.cpp:154
tesseract_common::VectorIsometry3d
AlignedVector< Eigen::Isometry3d > VectorIsometry3d
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::contactTest
void contactTest(ContactResultMap &collisions, const ContactRequest &request) override final
Perform a contact test for all objects based.
Definition: bullet_cast_bvh_manager.cpp:478
tesseract_common::CollisionMarginData::setCollisionMargin
void setCollisionMargin(const std::string &obj1, const std::string &obj2, double collision_margin)
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::onCollisionMarginDataChanged
void onCollisionMarginDataChanged()
This function will update internal data when margin data has changed.
Definition: bullet_cast_bvh_manager.cpp:524
tesseract_collision::tesseract_collision_bullet::EMPTY_COLLISION_SHAPES_TRANSFORMS
static const tesseract_common::VectorIsometry3d EMPTY_COLLISION_SHAPES_TRANSFORMS
Definition: bullet_cast_bvh_manager.cpp:50
tesseract_common::CollisionMarginData::getMaxCollisionMargin
double getMaxCollisionMargin() const
tesseract_collision::tesseract_collision_bullet
Definition: bullet_cast_bvh_manager.h:48
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setCollisionMarginData
void setCollisionMarginData(CollisionMarginData collision_margin_data) override final
Set the contact distance threshold.
Definition: bullet_cast_bvh_manager.cpp:430
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setContactAllowedValidator
void setContactAllowedValidator(std::shared_ptr< const tesseract_common::ContactAllowedValidator > validator) override final
Set the active function for determining if two links are allowed to be in collision.
Definition: bullet_cast_bvh_manager.cpp:468
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::addCollisionObject
bool addCollisionObject(const std::string &name, const int &mask_id, const CollisionShapesConst &shapes, const tesseract_common::VectorIsometry3d &shape_poses, bool enabled=true) override final
Add a collision object to the checker.
Definition: bullet_cast_bvh_manager.cpp:113
tesseract_collision::ContinuousContactManager::UPtr
std::unique_ptr< ContinuousContactManager > UPtr
Definition: continuous_contact_manager.h:48
tesseract_collision::tesseract_collision_bullet::TesseractCollisionConfigurationInfo
Definition: tesseract_collision_configuration.h:52
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getCollisionObjects
const std::vector< std::string > & getCollisionObjects() const override final
Get all collision objects.
Definition: bullet_cast_bvh_manager.cpp:370
contact_allowed_validator.h
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setCollisionMarginPair
void setCollisionMarginPair(const std::string &name1, const std::string &name2, double collision_margin) override final
Set the margin for a given contact pair.
Definition: bullet_cast_bvh_manager.cpp:460
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::BulletCastBVHManager
BulletCastBVHManager(std::string name="BulletCastBVHManager", TesseractCollisionConfigurationInfo config_info=TesseractCollisionConfigurationInfo())
Definition: bullet_cast_bvh_manager.cpp:52
bullet_cast_bvh_manager.h
Tesseract ROS Bullet cast(continuous) BVH collision manager.
tesseract_collision::ContactTestData::done
bool done
Indicate if search is finished.
Definition: types.h:355
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::dispatcher_
std::unique_ptr< btCollisionDispatcher > dispatcher_
The bullet collision dispatcher used for getting object to object collison algorithm.
Definition: bullet_cast_bvh_manager.h:152
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::disableCollisionObject
bool disableCollisionObject(const std::string &name) override final
Disable an object.
Definition: bullet_cast_bvh_manager.cpp:202
tesseract_collision::tesseract_collision_bullet::CastHullShape
This is a casted collision shape used for checking if an object is collision free between two transfo...
Definition: bullet_utils.h:155
tesseract_collision::isLinkActive
bool isLinkActive(const std::vector< std::string > &active, const std::string &name)
This will check if a link is active provided a list. If the list is empty the link is considered acti...
Definition: common.cpp:80
tesseract_common::TransformMap
AlignedMap< std::string, Eigen::Isometry3d > TransformMap
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::incrementCollisionMargin
void incrementCollisionMargin(double increment) override final
Increment the collision margin data by some value.
Definition: bullet_cast_bvh_manager.cpp:454
tesseract_collision::tesseract_collision_bullet::updateBroadphaseAABB
void updateBroadphaseAABB(const COW::Ptr &cow, const std::unique_ptr< btBroadphaseInterface > &broadphase, const std::unique_ptr< btCollisionDispatcher > &dispatcher)
Update the Broadphase AABB for the input collision object.
Definition: bullet_utils.cpp:1355
tesseract_collision::tesseract_collision_bullet::TesseractCollisionConfigurationInfo::clone
TesseractCollisionConfigurationInfo clone() const
Clone the collision configuration information.
Definition: tesseract_collision_configuration.cpp:63
tesseract_collision::ContactTestData::active
const std::vector< std::string > * active
A vector of active links.
Definition: types.h:340
tesseract_collision::tesseract_collision_bullet::EMPTY_COLLISION_SHAPES_CONST
static const CollisionShapesConst EMPTY_COLLISION_SHAPES_CONST
Definition: bullet_cast_bvh_manager.cpp:49
tesseract_collision::ContactTestData::validator
std::shared_ptr< const tesseract_common::ContactAllowedValidator > validator
The allowed collision function used to check if two links should be excluded from collision checking.
Definition: types.h:346
tesseract_collision::tesseract_collision_bullet::createCollisionObject
COW::Ptr createCollisionObject(const std::string &name, const int &type_id, const CollisionShapesConst &shapes, const tesseract_common::VectorIsometry3d &shape_poses, bool enabled=true)
Definition: bullet_utils.cpp:1161
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::name_
std::string name_
Definition: bullet_cast_bvh_manager.h:146
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getCollisionObjectGeometries
const CollisionShapesConst & getCollisionObjectGeometries(const std::string &name) const override final
Get a collision objects collision geometries.
Definition: bullet_cast_bvh_manager.cpp:134
transform
template Halfspace< double > transform(const Halfspace< double > &a, const Transform3< double > &tf)
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::dispatch_info_
btDispatcherInfo dispatch_info_
The bullet collision dispatcher configuration information.
Definition: bullet_cast_bvh_manager.h:154
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getContactAllowedValidator
std::shared_ptr< const tesseract_common::ContactAllowedValidator > getContactAllowedValidator() const override final
Get the active function for determining if two links are allowed to be in collision.
Definition: bullet_cast_bvh_manager.cpp:474
tesseract_collision::tesseract_collision_fcl::collisionCallback
bool collisionCallback(fcl::CollisionObjectd *o1, fcl::CollisionObjectd *o2, void *data)
Definition: fcl_utils.cpp:219
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::clone
ContinuousContactManager::UPtr clone() const override final
Clone the manager.
Definition: bullet_cast_bvh_manager.cpp:87
tesseract_common::CollisionMarginData
tesseract_collision::ContactTestData::collision_margin_data
CollisionMarginData collision_margin_data
The current contact_distance threshold.
Definition: types.h:343
tesseract_collision::tesseract_collision_bullet::makeCastCollisionObject
COW::Ptr makeCastCollisionObject(const COW::Ptr &cow)
Definition: bullet_utils.cpp:1249
tesseract_collision::tesseract_collision_bullet::addCollisionObjectToBroadphase
void addCollisionObjectToBroadphase(const COW::Ptr &cow, const std::unique_ptr< btBroadphaseInterface > &broadphase, const std::unique_ptr< btCollisionDispatcher > &dispatcher)
Add the collision object to broadphase.
Definition: bullet_utils.cpp:1382
tesseract_collision::tesseract_collision_bullet::TesseractCollisionPairCallback
A callback function that is called as part of the broadphase collision checking.
Definition: bullet_utils.h:332
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getCollisionMarginData
const CollisionMarginData & getCollisionMarginData() const override final
Get the contact distance threshold.
Definition: bullet_cast_bvh_manager.cpp:436
tesseract_collision::tesseract_collision_bullet::removeCollisionObjectFromBroadphase
void removeCollisionObjectFromBroadphase(const COW::Ptr &cow, const std::unique_ptr< btBroadphaseInterface > &broadphase, const std::unique_ptr< btCollisionDispatcher > &dispatcher)
Remove the collision object from broadphase.
Definition: bullet_utils.cpp:1368
name
std::string name
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::broadphase_overlap_cb_
TesseractOverlapFilterCallback broadphase_overlap_cb_
Filter collision objects before broadphase check.
Definition: bullet_cast_bvh_manager.h:173
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getCollisionObjectGeometriesTransforms
const tesseract_common::VectorIsometry3d & getCollisionObjectGeometriesTransforms(const std::string &name) const override final
Get a collision objects collision geometries transforms.
Definition: bullet_cast_bvh_manager.cpp:142
tesseract_collision::ContactResultMap
This structure hold contact results for link pairs.
Definition: types.h:155
tesseract_common::CollisionMarginPairOverrideType
CollisionMarginPairOverrideType
tesseract_collision::tesseract_collision_bullet::CollisionObjectWrapper::Ptr
std::shared_ptr< CollisionObjectWrapper > Ptr
Definition: bullet_utils.h:96
tesseract_collision::tesseract_collision_fcl::KinematicFilter
@ KinematicFilter
Definition: fcl_utils.h:69
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getActiveCollisionObjects
const std::vector< std::string > & getActiveCollisionObjects() const override final
Get which collision objects can move.
Definition: bullet_cast_bvh_manager.cpp:428
tesseract_collision::tesseract_collision_bullet::CastBroadphaseContactResultCallback
Definition: bullet_utils.h:302
tesseract_collision::CollisionShapesConst
std::vector< CollisionShapeConstPtr > CollisionShapesConst
Definition: types.h:51
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::enableCollisionObject
bool enableCollisionObject(const std::string &name) override final
Enable an object.
Definition: bullet_cast_bvh_manager.cpp:174
tesseract_common::CollisionMarginData::apply
void apply(const CollisionMarginPairData &pair_margin_data, CollisionMarginPairOverrideType override_type)
tesseract_collision::ContactTestData::res
ContactResultMap * res
Distance query results information.
Definition: types.h:352
tesseract_common::CollisionMarginData::incrementMargins
void incrementMargins(double increment)
gDbvtMargin
btScalar gDbvtMargin
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::link2cow_
Link2Cow link2cow_
A map of collision objects being managed.
Definition: bullet_cast_bvh_manager.h:162
tesseract_common::CollisionMarginPairData
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::coll_config_
TesseractCollisionConfiguration coll_config_
The bullet collision configuration.
Definition: bullet_cast_bvh_manager.h:158
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setDefaultCollisionMargin
void setDefaultCollisionMargin(double default_collision_margin) override final
Set the default collision margin.
Definition: bullet_cast_bvh_manager.cpp:448
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::link2castcow_
Link2Cow link2castcow_
A map of cast collision objects being managed.
Definition: bullet_cast_bvh_manager.h:164
type
type
tesseract_collision::ContactTestData::req
ContactRequest req
The type of contact request data.
Definition: types.h:349
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setCollisionObjectsTransform
void setCollisionObjectsTransform(const std::string &name, const Eigen::Isometry3d &pose) override final
Set a single static collision object's tansforms.
Definition: bullet_cast_bvh_manager.cpp:239
tesseract_common::CollisionMarginData::setDefaultCollisionMargin
void setDefaultCollisionMargin(double default_collision_margin)
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::isCollisionObjectEnabled
bool isCollisionObjectEnabled(const std::string &name) const override final
Check if collision object is enabled.
Definition: bullet_cast_bvh_manager.cpp:230
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::contact_test_data_
ContactTestData contact_test_data_
This is used when contactTest is called. It is also added as a user point to the collsion objects so ...
Definition: bullet_cast_bvh_manager.h:170
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::hasCollisionObject
bool hasCollisionObject(const std::string &name) const override final
Find if a collision object already exists.
Definition: bullet_cast_bvh_manager.cpp:149
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setCollisionMarginPairData
void setCollisionMarginPairData(const CollisionMarginPairData &pair_margin_data, CollisionMarginPairOverrideType override_type=CollisionMarginPairOverrideType::REPLACE) override final
Set the pair contact distance thresholds for which collision should be considered on a per pair basis...
Definition: bullet_cast_bvh_manager.cpp:441
tesseract_collision::tesseract_collision_bullet::convertEigenToBt
btVector3 convertEigenToBt(const Eigen::Vector3d &v)
Definition: bullet_utils.cpp:62
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::config_info_
TesseractCollisionConfigurationInfo config_info_
The bullet collision configuration information.
Definition: bullet_cast_bvh_manager.h:156
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::setActiveCollisionObjects
void setActiveCollisionObjects(const std::vector< std::string > &names) override final
Set which collision objects can move.
Definition: bullet_cast_bvh_manager.cpp:372
tesseract_collision::tesseract_collision_bullet::updateCollisionObjectFilters
void updateCollisionObjectFilters(const std::vector< std::string > &active, const COW::Ptr &cow)
Update a collision objects filters.
Definition: bullet_utils.cpp:442
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::collision_objects_
std::vector< std::string > collision_objects_
A list of the collision objects.
Definition: bullet_cast_bvh_manager.h:150
tesseract_collision::ContactRequest
The ContactRequest struct.
Definition: types.h:300
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::active_
std::vector< std::string > active_
A list of the active collision objects.
Definition: bullet_cast_bvh_manager.h:148
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::getName
std::string getName() const override final
Get the name of the contact manager.
Definition: bullet_cast_bvh_manager.cpp:85
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::broadphase_
std::unique_ptr< btBroadphaseInterface > broadphase_
The bullet broadphase interface.
Definition: bullet_cast_bvh_manager.h:160
tesseract_collision::tesseract_collision_bullet::BulletCastBVHManager::~BulletCastBVHManager
~BulletCastBVHManager() override
Definition: bullet_cast_bvh_manager.cpp:74
tesseract_collision::CollisionMarginData
tesseract_common::CollisionMarginData CollisionMarginData
Definition: types.h:52


tesseract_collision
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:52