[ODE] RE: fDir1 friction problem

Bjoern Mahn bjoern.mahn at ais.fraunhofer.de
Tue Jul 29 03:51:02 2003


Hi Ken,

> I'm developing a vehicle simulation and its important that I'm able to
> set separate longitudinal and lateral friction coefficients for tyres.
> Looking through the ODE docs this seems to be simply a case of enabling
> dContactFDir1 and dContactMu2. 

I did exactly the same and it works fine (omnidirectional drive). You can put 
this into your collision code and it should work:

------ code ------
const dReal* r;
 
contact->surface.mode = dContactMu2 | dContactBounce | dContactFDir1
    | dContactSlip1 | dContactSlip2; 
contact->surface.bounce     = 0.3;
contact->surface.bounce_vel = 0.05;
contact->surface.slip1      = WHEEL_AXIAL_SLIP;
contact->surface.slip2      = WHEEL_FRONT_SLIP;
contact->surface.mu         = WHEEL_AXIAL_FRICTION;
contact->surface.mu2        = WHEEL_FRONT_FRICTION;


r = dBodyGetRotation(bWheel);
contact->fdir1[0] = r[2];
contact->fdir1[1] = r[6];
contact->fdir1[2] = r[10];
------ end code -------

I took a sphere as mass and geom of the wheel (unfortunately the 
cylinderclass contains collision problems). Then, I rotated it 90 degrees 
around the x-axis, so that the z-axis is the axis of the wheel. If you want 
to use another axis for your wheel, simply change r[2] and r[6] and r[10] to:
r[0]
r[4]
r[8]
or
r[1]
r[5]
r[9]

-- 
Best regards,
 Björn Mahn