[ODE] Bike simulation

Nate W coding at natew.com
Wed Aug 14 08:54:01 2002


On Wed, 14 Aug 2002, Aanand Narayanan.P.P wrote:

>             Did anybody try to do a Bike simulation using ODE?
>             I would like to know the details if you don’t mind.
> Basically I want to know how the ‘tilt’ (as in superbikes), 180 degree
> skid turns, wheelies etc can be done using ODE. Can we achieve these
> using the default joints and modifying the parameters? Or do I have to
> make my own joints for these?

I've done a motorcycle simulation that leans into corners, does wheelies,
skids a little bit (but usually tumbles, because controlled skids take
better reflexes than I seem to have).  It also requires counter-steering
force to drive around - you have to 'push the handlebars' in the opposite
direction of the turn to get the bike to steer properly.  The whole I
reason I made this simulation was to see if that would happen, so it was
kinda gratifying when it worked. :-)

I used a slider joint for the 'forks,' and hinge joints for the steering,
axles, and rear suspension.  I also used spheres for the tires.  That
looks kinda silly but it works.  Flat-ended cylinders would be better, and
toruses (tori?) would be better still, but last I checked ODE had no
support for those.  Even so, it works pretty well, if I may say so myself.  
If you want to check it out, download my application and open the
'motorcycle.jm' file that comes with it.  Installation in structions and
download links are at http://www.natew.com/juice/

You'll need a three-axis joystick, or two regular joysticks, to control
the bike.  I use a Microsoft Sidewinder with steering assigned to the
'twist' axis, rider lean assigned to the left-right axis, and throttle on
either the throttle slider or y-axis, depending on my mood.  With two
sticks you could put steering and rider lean on the left-right axis of
each stick.  I haven't tried using two joysticks though, so let me know if
that doesn't work. :-)

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com