[ODE] Help for simulating wheels mobile robot by ODE

=?GB2312?B?xe3Qy87E?= hzctypxw at gmail.com
Thu Nov 8 01:33:23 MST 2007


>From the ODE mail lists and other user manual, I have read a lot about how
to simulate the car by ODE.
The difficult is how to set the contact parameters.
Now I want to simulating the physics behavior of  a real wheels mobile
robot.

My real mobile robot has six wheels. Each one is about 5 kg. And the Body is
about 30 kg. The length unit is meter.
The gravity is set to 9.8. I know it will be very heavy under the earth
gravity.
So I set the wheels, ground, a slope named ground_box to be dGeom and  make
the  nearCallback function bellow:

//the dBodyID of 6 wheels are defined as body[1],body[2],...,body[6] and the
dGeomID are sphere[0]...shpere[1]. in fact the type of the Geom are cylinder
//the dGeomID of ground and grond_box are named ground and ground_box

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

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

  const int N = 20;
  dContact contact[N];
  n = dCollide (o1,o2,N,&contact[0].geom,sizeof(dContact));
  if (n > 0) {
    for (i=0; i<n; ++i) {
        dVector3 FDIR1;
        dReal v;
        for (int j=0; j<6; ++j)
        {
            if (o2 == sphere[j] || o1 == sphere[j])
            {
                const dReal *w = dBodyGetAngularVel(body[j+1]);
               v = -w[2];
               dBodyVectorToWorld(body[j+1],0,0,1,FDIR1);
               break;
            }
        }

        contact[i].fdir1[0] = FDIR1[0];
        contact[i].fdir1[1] = FDIR1[1];
        contact[i].fdir1[2] = FDIR1[2];

        contact[i].surface.mode = dContactMu2| dContactSlip2 |
dContactBounce
                                |dContactSoftERP | dContactSoftCFM

        contact[i].surface.mu = 0.7;
        contact[i].surface.mu2 = dInfinity;
       //contact[i].surface.slip1 = 0.001;
        contact[i].surface.slip2 =  0.004*v;
        contact[i].surface.bounce = 0.1;
        contact[i].surface.soft_erp = 0.8;
        contact[i].surface.soft_cfm = 0.01;

        dJointID c = dJointCreateContact (world,contactgroup,&contact[i]);
        dJointAttach (c,
                      dGeomGetBody(contact[i].geom.g1),
                      dGeomGetBody(contact[i].geom.g2));
    }
  }
}
The first question is:
We know the slide motion of a vehicle hardly ever happened and it behave
like a cohesion friction along the roll axis of wheels.
So I close the slip1and set the mu to 0.7.  But the ODE says a LCP internal
error.

The second question is:
>From the tyre physics, we know the force adding on the tyres come from the
ground. So how the slip1 and slip2 simulate this kind
of force?

Please help me to clear this two questions. And if it is possible, can
someone show me some samples for how to set these parameters
when using ODE  to simulate a car .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ode.org/pipermail/ode/attachments/20071108/863ed1a3/attachment.htm


More information about the ODE mailing list