[ODE] RE: ODE digest, Vol 1 #731 - 13 msgs

Ken MacLeod kjmac at freenet.co.uk
Wed Jul 30 04:35:02 2003


Thanks for the help Björn - your method does indeed work. It seems that
the reason why I was having trouble is that I was specifying the x-axis
(longitudinal) as fdir1. When I change fdir1 to the y-axis(lateral) both
friction directions can be made to work correctly.

This is odd as in the ODE docs I quote "set friction direction 1 in the
direction that the tire is rolling in”, and in most cases this is taken
to be the x-axis as I suspect many people developing car sims are using
the SAE coordinate convention.

So in my case the quote should be: 
Set friction direction 1 to the direction of wheel spin axis, or
alternatively (and more correctly) the lateral contact patch axis.

Worth a note in the docs?

Ken


Message: 5
From: Bjoern Mahn <bjoern.mahn@ais.fraunhofer.de>
Organization: Fraunhofer AIS
To: ode@q12.org
Date: Tue, 29 Jul 2003 13:02:10 +0200
Subject: [ODE] RE: fDir1 friction problem

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

--__--__--