penetration depth of colliding concave and convex objects

jstolarz
Posts: 14
Joined: Thu Dec 09, 2010 9:32 pm
Location: Glendale, California

penetration depth of colliding concave and convex objects

Post by jstolarz »

Hello,

I'm trying to get the full penetration depth of a colliding pair of a concave and convex object.

From the persistent manifold I get 4 contact points. Those have the m_distance1 member which represents the depth of that contact point, but is the deepest of those 4 guaranteed to be at the full penetration depth (or at least close)? From my experimentation it doesn't seem to be the case.

Ideally, I'd use the pair detector or MinkowskiPenetrationDepthSolver for this, but these both require convex objects. Is there a way to take the above points and "extract" the full depth?

For background, I have a robotic figure using the discrete CD algorithms for preventing collisions. When one is detected I stop motion and would like to disallow motions that would "worsen" the collision, but allow motions that "reduce" (i.e. back out). I tried the below algorithm and it often worked, but sometimes when moving out of collision, the lowest of the new set of points that was created in the next loop had a lower distance value than the lowest of the previous loop, resulting in the robot stopping when I'd rather it not.

Code: Select all

 
double lowest = DBL_MAX;
for (int j = 0; j < numContacts; j++) {
   double dist = contactManifold->getContactPoint(j).getDistance();
   if (dist < lowest)
      lowest = dist;
}
if (lowest < prevLowestDist)
   stopMotion()
else
   allowMotion()
prevLowestDist = lowest;
Thanks.