[ODE] Contact in articulated bodies (newbie question)

Joshua Hale jhale at atr.jp
Fri Nov 19 09:46:15 MST 2004


Dear List-members,

I have just put together a simple articulated humanoid model and am 
trying to sort out the contacts. I find that the contacts are frequently 
resolved with excessive forces so that the figure is launched into the 
air. I am wondering if there is something simple I should do to resolve 
the problem?

I have set the masses/dimensions around the value 1. I am only checking 
for contact between my figure's feet and the floor since I don't want it 
to fall over (so I don't care if it goes through the floor since falling 
over at all is a mistake). I have managed a simulation step of 
0.0001-0.0005 (with a frame rate of 0.05). I've copied my contact 
callback below (which is taken from test_buggy.cpp).

Any suggestions very much appreciated!

Thanks,

Josh.

static void nearCallback(void *data, dGeomID o1, dGeomID o2)
{
   int i, n;

   // only collide things with the ground
   int g1 = (o1 == ground);
   int g2 = (o2 == ground);
   if (!(g1 ^ g2))
       return;

   const int N = 10;
   dContact contact[N];
   n = dCollide(o1, o2, N, &contact[0].geom, sizeof (dContact));
   if (n > 0) {
       for (i = 0; i < n; i++) {
           contact[i].surface.mode = dContactSlip1 | dContactSlip2 |
               dContactSoftERP | dContactSoftCFM | dContactApprox1;
           contact[i].surface.mu = dInfinity;
           contact[i].surface.slip1 = 0.1;
           contact[i].surface.slip2 = 0.1;
           contact[i].surface.soft_erp = 0.5;
           contact[i].surface.soft_cfm = 0.3;
           dJointID c = dJointCreateContact(world, contactgroup, 
&contact[i]);
           dJointAttach(c,
                                    dGeomGetBody(contact[i].geom.g1),
                                    dGeomGetBody(contact[i].geom.g2));
       }
   }
}


-- 
Joshua G. Hale, Ph.D.				Tel +81 774 95 2403
ATR Computational Neuroscience Laboratories	Fax +81 774 95 1236
2-2-2 Hikaridai "Keihanna Science City"		josh(at)joshhale.com
Seiko-cho Souraku-gun Kyoto 619-0288 Japan	www.joshhale.com



More information about the ODE mailing list