Skip to content

Commit

Permalink
Disable collision shape caching in bullet and fcl (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong authored Jan 29, 2025
1 parent e2f847a commit 708141a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 9 additions & 5 deletions tesseract_collision/bullet/src/bullet_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,14 @@ std::shared_ptr<btCollisionShape> createShapePrimitive(const tesseract_geometry:

std::shared_ptr<btCollisionShape> createShapePrimitive(const CollisionShapeConstPtr& geom, CollisionObjectWrapper* cow)
{
std::shared_ptr<btCollisionShape> shape = BulletCollisionShapeCache::get(geom);
if (shape != nullptr)
return shape;

// std::shared_ptr<btCollisionShape> shape = BulletCollisionShapeCache::get(geom);
// if (shape != nullptr)
// {
// // sleep(1000);
// return shape;
// }

std::shared_ptr<btCollisionShape> shape;
switch (geom->getType())
{
case tesseract_geometry::GeometryType::BOX:
Expand Down Expand Up @@ -401,7 +405,7 @@ std::shared_ptr<btCollisionShape> createShapePrimitive(const CollisionShapeConst
// LCOV_EXCL_STOP
}

BulletCollisionShapeCache::insert(geom, shape);
// BulletCollisionShapeCache::insert(geom, shape);
return shape;
}

Expand Down
12 changes: 6 additions & 6 deletions tesseract_collision/fcl/src/fcl_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ CollisionGeometryPtr createShapePrimitiveHelper(const CollisionShapeConstPtr& ge

CollisionGeometryPtr createShapePrimitive(const CollisionShapeConstPtr& geom)
{
CollisionGeometryPtr shape = FCLCollisionGeometryCache::get(geom);
if (shape != nullptr)
return shape;
// CollisionGeometryPtr shape = FCLCollisionGeometryCache::get(geom);
// if (shape != nullptr)
// return shape;

shape = createShapePrimitiveHelper(geom);
FCLCollisionGeometryCache::insert(geom, shape);
return shape;
// shape = createShapePrimitiveHelper(geom);
// FCLCollisionGeometryCache::insert(geom, shape);
return createShapePrimitiveHelper(geom);
}

bool collisionCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void* data)
Expand Down

0 comments on commit 708141a

Please sign in to comment.