[ODE] fDir1 friction problem
Ken MacLeod
kjmac at freenet.co.uk
Mon Jul 28 04:46:02 2003
Hi,
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.
fDir1 is then set to the longitudinal wheel axis. The original mu value
then represents the longitudinal (x-axis) friction coefficient, and mu2
is set for the lateral coefficient (y-axis).
Sounds good, but it doesn't work! In the midst of the collision code I
have, for a test:
contact[i].surface.mu = 0;
contact[i].surface.mu2 = dInfinity;
The body that this applies to should be able to slide freely along its
x-axis, and indeed it can. However it can also slide freely along its
y-axis, which it should not be able to do (as infinite friction).
It's quite possible that I've done something stupid here, so I've
created a test program to demonstrate my problem (tested with ode 0.035
and latest cvs). This can be found at the following URLs.
Source code:
http://www.reactoroverload.com/downloads/test_fdir1.cpp
Source code and executable:
http://www.reactoroverload.com/downloads/fdir_problem.zip
The program drops a box onto a flat ground plane. It should only be able
to slide fore/aft but not from side to side. Press x to toggle a force
applied along its x-axis, press y to toggle a force applied along its
y-axis. Space resets the box.
Any help is most welcome,
Ken MacLeod