ODE - trying to make a car/vehicle

Hi

I have been trying to make a car with open dynamics engine, but it seems to take tons of time and I am not even sure am I getting anywhere with it (currently I have 4 balls connected to a box with hidge2joints (not sure have I done it properly), so here I am asking for guidance.

Does a vehicle/car example (or a game demo that contains car(s) made with ODE) exist for Python and if anyone knows one, where can I find it? I have already done some googling and browsed these forums without any success. Code snippets etc. are welcome as well, of course.

Cheers,

There should be an example in demomaster (but I’ve never played with that, sorry).

There is one in demomaster, based on :
discourse.panda3d.org/viewtopic.php?t=5646

Many thanks for the link.

One problem remains and that is how to make the vehicle not to roll over when turning in high speed (or in case of my vehicle even in slower speeds (as it has more suspension))?

opende.sourceforge.net/wiki/inde … el_vehicle

It gives kind of the idea, but leaves a question how to get the swayForce? I am assuming it is something really simple, as it is not explained there?

For some reason I have a feeling that even if I would get that implemented, the car would still be far from playable. Anyone done those antiswaybars and was happy for the end result in non-plain enviroment?

What do you mean by not playable ?
May be you can download and try out the sample in demomaster and see if it is playable by your definition. And you can add the swayForce implementation on top to fix roll over issues, if found.

Maybe I used a wrong term or something. The demo has the “roll over issue” (meaning in this case that in faster speeds or tight turns it spins way too easily) and if implementing the anti-sway bars would be easy (for me), I would have done it already. Problem is the swayForce (attribute) mentioned on that example, I have no idea where to get it and what exactly it is and if the solution works as I think it might, as it might not (as things like i^1 are confusing and nature of swayForce is a quess), it might not be very useful in bumpy track O_o So I was interested of if someone has already done a car like that, so I would know will I be wasting my time or not by decrypt that anti-sway bar code.

"
wheels[i].Body.AddForce(-axis *amt); //downforce
wheels[i^1].Body.AddForce(axis *amt); //upforce
"

and 18 seconds after… are you referring to the demo mentioned on the first post or the demo mentioned later (the link that leads nowhere)?

I refer to demomaster

I too have been making a vehicle with ODE, exactly like Q described (if anyone remembers my previous questions about the built in Panda physics, I have seen the light and started using ODE. If anyone else is apprehensive about it’s complexity, just dive in, its actually very logical!). I am using 4 spheres for wheels, attached to a body via hinge2 joints.

My car rolls over very easily when cornering, which I understand is because the ODE physics are realistic, so I need to implement realistic solutions, such as sway bars and lower center of gravity.

The solution in the ODE wiki makes some sense, but I have two issues with their calculation of the “anti sway force”

The force is proportional to the difference in the vertical (relative to the vehicle) displacement of the opposite wheels, i.e. how much the suspension is compressed.

Issue 1) This solution depends on how “flexy” the suspension is, and I cannot find out how to adjust this in the OdeHinge2Joint. Does anyone know how to adjust/set the travel and stiffness?

Issue 2) The sway force will be applied even if the wheels aren’t on the ground, so this might make for some weird rollover dynamics.

I think the logical solution is to get the upward force being applied to a wheel by the ground (or by the wheel on the suspension) and then apply it in the opposite direction on the opposite wheel, but how do I find that force?

Hope I haven’t been too verbose, just trying to be clear :wink: