<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ode.org/wiki/index.php?action=history&amp;feed=atom&amp;title=HOWTO_build_a_4_wheel_vehicle</id>
	<title>HOWTO build a 4 wheel vehicle - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ode.org/wiki/index.php?action=history&amp;feed=atom&amp;title=HOWTO_build_a_4_wheel_vehicle"/>
	<link rel="alternate" type="text/html" href="https://ode.org/wiki/index.php?title=HOWTO_build_a_4_wheel_vehicle&amp;action=history"/>
	<updated>2026-04-08T18:08:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://ode.org/wiki/index.php?title=HOWTO_build_a_4_wheel_vehicle&amp;diff=85&amp;oldid=prev</id>
		<title>imported&gt;Russ: Created page with &quot;Good examples of making working vehicles are Jon Watte&#039;s [http://www.mindcontrol.org/~hplus/carworld.html carworld] and [http://www.enchantedage.com/raycar raycar]. You could...&quot;</title>
		<link rel="alternate" type="text/html" href="https://ode.org/wiki/index.php?title=HOWTO_build_a_4_wheel_vehicle&amp;diff=85&amp;oldid=prev"/>
		<updated>2019-01-07T03:37:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Good examples of making working vehicles are Jon Watte&amp;#039;s [http://www.mindcontrol.org/~hplus/carworld.html carworld] and [http://www.enchantedage.com/raycar raycar]. You could...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Good examples of making working vehicles are Jon Watte&amp;#039;s [http://www.mindcontrol.org/~hplus/carworld.html carworld] and [http://www.enchantedage.com/raycar raycar]. You could maybe flesh out this article using those two. Raycar is the simplest.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
If you came here, you probably already know that building a working vehicle in ODE isn&amp;#039;t that easy. Maybe you notice that the wheels have trouble turning when rotating at high speeds? Maybe you encountered the lostop/histop bug in ODE 0.5. Maybe you noticed your vehicle flips over when turning, when going at moderate speeds?&lt;br /&gt;
&lt;br /&gt;
All this is because ODE is a pretty accurate simulator. Here&amp;#039;s a hint: Implement the same workarounds that have been put in real cars.&lt;br /&gt;
&lt;br /&gt;
== Stop rolling over ==&lt;br /&gt;
&lt;br /&gt;
To stop rolling over in high speed turns, make sure that you:&lt;br /&gt;
&lt;br /&gt;
# Implement force-dependent slip. See the slip1 and slip2 parameters of a contact surface.&lt;br /&gt;
# Reduce the tyre/road friction. Use low values in the mu and mu2 fields of a contact surface.&lt;br /&gt;
# Keep the center of mass for the chassis low, wrt the wheel bodies.&lt;br /&gt;
&lt;br /&gt;
If you do all this, and your car still rolls over, you can consider implementing &amp;quot;anti-sway bars&amp;quot;. In real vehicles, these were bars that linked each opposite suspension, so that when one side is pressed down (when going in a curve), it also pressed down on the suspension on the other side. This prevents the car from tilting over too much.&lt;br /&gt;
&lt;br /&gt;
This is an example of how to compute the force adapted from the OgreVehicle class assuming 4 wheels:&lt;br /&gt;
&lt;br /&gt;
 void applyAntiSwayBarForces() {&lt;br /&gt;
    amt = 0;&lt;br /&gt;
    for(int i = 0; i &amp;lt; 4; i++) {				&lt;br /&gt;
        Vector3 anchor2 = wheels[i].Joint.Anchor2;&lt;br /&gt;
        Vector3 anchor1 = wheels[i].Joint.Anchor;&lt;br /&gt;
        Vector3 axis = wheels[i].Joint.Axis2;&lt;br /&gt;
 &lt;br /&gt;
        displacement = Vector3.Dot(anchor1-anchor2, axis);&lt;br /&gt;
 &lt;br /&gt;
        if(displacement &amp;gt; 0) {&lt;br /&gt;
            amt = displacement * swayForce;&lt;br /&gt;
            if(amt &amp;gt; swayForceLimit)&lt;br /&gt;
                amt = swayForceLimit;&lt;br /&gt;
            wheels[i].Body.AddForce(-axis *amt); //downforce&lt;br /&gt;
            wheels[i^1].Body.AddForce(axis *amt); //upforce&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Check the FAQ ==&lt;br /&gt;
&lt;br /&gt;
The [[FAQ]] addresses many issues that might arise in a car simulation, like wheels getting stuck in geoms, or numerical errors in the hinge constraints. Be sure to check it.&lt;/div&gt;</summary>
		<author><name>imported&gt;Russ</name></author>
	</entry>
</feed>