Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Fix issue #2175
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniferBuehler committed May 12, 2017
1 parent 4a10aa2 commit 69b2841
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions gazebo/physics/ode/ODEPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -960,16 +960,6 @@ void ODEPhysics::CollisionCallback(void *_data, dGeomID _o1, dGeomID _o2)
ODECollision *collision1 = nullptr;
ODECollision *collision2 = nullptr;

// Exit if both bodies are not enabled
if (dGeomGetCategoryBits(_o1) != GZ_SENSOR_COLLIDE &&
dGeomGetCategoryBits(_o2) != GZ_SENSOR_COLLIDE &&
((b1 && b2 && !dBodyIsEnabled(b1) && !dBodyIsEnabled(b2)) ||
(!b2 && b1 && !dBodyIsEnabled(b1)) ||
(!b1 && b2 && !dBodyIsEnabled(b2))))
{
return;
}

// Get pointers to the underlying collisions
if (dGeomGetClass(_o1) == dGeomTransformClass)
collision1 =
Expand All @@ -983,6 +973,18 @@ void ODEPhysics::CollisionCallback(void *_data, dGeomID _o1, dGeomID _o2)
else
collision2 = static_cast<ODECollision*>(dGeomGetData(_o2));

// Exit if both bodies are not enabled
if (dGeomGetCategoryBits(_o1) != GZ_SENSOR_COLLIDE &&
dGeomGetCategoryBits(_o2) != GZ_SENSOR_COLLIDE &&
!self->contactManager->NeverDropContacts() &&
!self->contactManager->SubscribersConnected(collision1, collision2) &&
((b1 && b2 && !dBodyIsEnabled(b1) && !dBodyIsEnabled(b2)) ||
(!b2 && b1 && !dBodyIsEnabled(b1)) ||
(!b1 && b2 && !dBodyIsEnabled(b2))))
{
return;
}

// Make sure both collision pointers are valid.
if (collision1 && collision2)
{
Expand Down

0 comments on commit 69b2841

Please sign in to comment.