(ODEJava) Ideas for car simulation?

Hi,

I’m about to try and create a car in ode with a good arcade feel to it, and I’m interested to hear if you guys have any good ideas. The goal is to create something with a nfs-underground feel, with suspension, gears and a handbrake.

What type of joints would you use, hinge2 with suspension or a slider joint with cfm and erp set or perhaps using raycasting? How about gears, using a AMotor or setting torques/velocities manually to the wheel bodies?
Spheres for wheels or capped cylinders? A simple box for chassis, or multiple geoms?

I’ve looked at the car example, but it is quite limited I think.

Hinge2 already has suspension CFM and ERM. No need for sliders and whatnot…

Capped Cylinder for wheels, however, spheres work fine and are cheaper IIRC. Chassis, you definetly need to have multiple bodies there. Because, sometimes if you hit a little 15 degree slope, the front bottom edge will hit it and if the car is moving fast enough, it will send the car flying! The hardest part will be keeping the car on the ground IMO because ODE doesn’t let you set the centre of gravity for the chassis. The centre is always in the middle. This means that the car will be unstable during turning. There are definetly ways around it as you will probably find out when you create your car.

Hope that helps.
DP

thx for the reply,

are hinge2 as fast and as stable as sliders and “whatnot”? :wink:
Chassis could perhaps be a box with capped cylinders as bumpers.

Hinge2 are fast and stable from experience. There are obviously with any thing, stress tests to see where it break. But i definetly haven’t go there with a car! (or multiple cars for that matter).

You are right about the chassis, but your going to have the graphics sometimes intersecting the terrain/road without any response…

In the Ode car example, there is something called “softCFM” which allows further penetration. Ive twiddled with the idea in my head for a while, but i never did any implementation to see how useful it is. Maybe this is what we need…maybe not…

Anyways, looking forward to seeing what you come up with!

DP

well, I’ve modified the car example, but came across the “12.9. I’ve made a car, but the wheels don’t stay on properly!”-problem as noted in the ODE-docs. The wheels are unstable at high speeds. I can’t seem to solve this, using the method described in the docs. Anyone else had this problem?

How are you rotating the wheels? Are you doing “setDesiredVelocityAroundAxis2()” ? Or are you applying a torque to move that tyre? AMotor?

If your going down the velocity route, i suggest you consider another one. Direct velocity setting is not recommended as ODE is a force engine, thus it will calculate the force required for the wheel to spin at that velocity. Now imagine a tyre at 0 angular momentum and in the next step, its going 40, its not going to be stable…

Whats your ERP? Setting that to 1.0 will usually solve the joint violation in the next step. But again, if the joint has been severly violated, any quick change in state is not ideal for ODE. I am yet to come across this problem and when I do, i’l definetly chime in and post some code…

DP

I’m setting the desired velocity parameter on the hinge2 (2-axis) as well as max force on that axis. It’s my understanding that ODE will accel up to that velocity using the max force, so its not like I’m manually setting the velocity of the wheel. I’ve so far used the default ERP (0.8?). I’m playing around with FDir and slip parameters, but I haven’t really done anything useful yet.