[ODE] Steering question

DjArcas djarcas at hotmail.com
Sat Jun 14 07:04:02 2003


This is a multi-part message in MIME format.

------=_NextPart_000_00C6_01C33286.959F2FF0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

You can tell I'm just starting on a car, can't you? :)

anyways... there seems to be a lot of ways to set the steering up. The =
buggy isn't really a very good example of how to do this (as it doesn't =
really behave like a car's steering - if I push 50% left, I want it to =
turn and stop steering at 50% of it's travel, not steer until the stop =
at 50% of the speed it can move at)

I've moving my wheels (2 and 3 in the array) like this:

(lSteer is between -1000 and +1000, and is read directly off of a =
joystick)
if (lSteer > 100 || lSteer < -100)

{

//Set wheels stops between +1 and -1

    float lSteerRange =3D fabs(lSteer);=20

    dJointSetHinge2Param =
(lWheel[2].mPhysicAtomic.mWheelJoint,dParamLoStop,-lSteerRange/1000.0f);

    dJointSetHinge2Param =
(lWheel[2].mPhysicAtomic.mWheelJoint,dParamHiStop, lSteerRange/1000.0f);

    dJointSetHinge2Param =
(lWheel[3].mPhysicAtomic.mWheelJoint,dParamLoStop,-lSteerRange/1000.0f);

    dJointSetHinge2Param =
(lWheel[3].mPhysicAtomic.mWheelJoint,dParamHiStop, lSteerRange/1000.0f);

}

dJointSetHinge2Param(lWheel[2].mPhysicAtomic.mWheelJoint,dParamVel,lSteer=
 / 100.0f);

dJointSetHinge2Param(lWheel[3].mPhysicAtomic.mWheelJoint,dParamVel,lSteer=
 / 100.0f);

dJointSetHinge2Param =
(lWheel[2].mPhysicAtomic.mWheelJoint,dParamFMax,0.5f);

dJointSetHinge2Param =
(lWheel[3].mPhysicAtomic.mWheelJoint,dParamFMax,0.5f);



Is this a good way of setting up wheels so they travel to a specified =
turn angle, and come back (fairly) smoothly? I'm getting ALL sort of =
problems with the front wheels 'tripping over' themselves, and stopping =
dead, so I'm wondering if I've got the horse before the cart. Anyone got =
any input?

------=_NextPart_000_00C6_01C33286.959F2FF0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>You can tell I'm just starting on a =
car, can't you?=20
:)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>anyways... there seems to be a lot of =
ways to set=20
the steering up. The buggy isn't really a very good example of how to do =
this=20
(as it doesn't really behave like a car's steering - if I push 50% left, =
I want=20
it to turn and stop steering at 50% of it's travel, not steer until the =
stop at=20
50% of the speed it can move at)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've moving my wheels (2 and 3 in the =
array) like=20
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>(lSteer is between -1000 and +1000, and =
is read=20
directly off of a joystick)</FONT></DIV>
<DIV>
<P><FONT color=3D#0000ff>if</FONT> (<FONT color=3D#808080>lSteer</FONT> =
&gt; 100 ||=20
<FONT color=3D#808080>lSteer</FONT> &lt; -100)</P>
<P>{</P>
<P>//Set wheels stops between +1 and -1</P>
<P><FONT color=3D#0000ff>&nbsp;&nbsp;&nbsp; float</FONT> <FONT=20
color=3D#808080>lSteerRange</FONT> =3D <FONT =
color=3D#880000>fabs</FONT>(<FONT=20
color=3D#808080>lSteer</FONT>); </P>
<P><FONT color=3D#880000>&nbsp;&nbsp;&nbsp; dJointSetHinge2Param</FONT> =
(<FONT=20
color=3D#808080>lWheel</FONT>[2].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,dParamLoStop,-<FONT=20
color=3D#808080>lSteerRange</FONT>/1000.0f);</P>
<P><FONT color=3D#880000>&nbsp;&nbsp;&nbsp; dJointSetHinge2Param</FONT> =
(<FONT=20
color=3D#808080>lWheel</FONT>[2].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,<FONT =
color=3D#a000a0>dParamHiStop</FONT>, <FONT=20
color=3D#808080>lSteerRange</FONT>/1000.0f);</P>
<P><FONT color=3D#880000>&nbsp;&nbsp;&nbsp; dJointSetHinge2Param</FONT> =
(<FONT=20
color=3D#808080>lWheel</FONT>[3].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,dParamLoStop,-<FONT=20
color=3D#808080>lSteerRange</FONT>/1000.0f);</P>
<P><FONT color=3D#880000>&nbsp;&nbsp;&nbsp; dJointSetHinge2Param</FONT> =
(<FONT=20
color=3D#808080>lWheel</FONT>[3].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,<FONT =
color=3D#a000a0>dParamHiStop</FONT>, <FONT=20
color=3D#808080>lSteerRange</FONT>/1000.0f);</P>
<P>}</P>
<P><FONT color=3D#880000>dJointSetHinge2Param</FONT>(<FONT=20
color=3D#808080>lWheel</FONT>[2].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,<FONT =
color=3D#a000a0>dParamVel</FONT>,<FONT=20
color=3D#808080>lSteer</FONT> / 100.0f);</P>
<P><FONT color=3D#880000>dJointSetHinge2Param</FONT>(<FONT=20
color=3D#808080>lWheel</FONT>[3].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,<FONT =
color=3D#a000a0>dParamVel</FONT>,<FONT=20
color=3D#808080>lSteer</FONT> / 100.0f);</P>
<P><FONT color=3D#880000>dJointSetHinge2Param</FONT> (<FONT=20
color=3D#808080>lWheel</FONT>[2].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,<FONT=20
color=3D#a000a0>dParamFMax</FONT>,0.5f);</P>
<P><FONT color=3D#880000>dJointSetHinge2Param</FONT> (<FONT=20
color=3D#808080>lWheel</FONT>[3].<FONT =
color=3D#808080>mPhysicAtomic</FONT>.<FONT=20
color=3D#808080>mWheelJoint</FONT>,<FONT=20
color=3D#a000a0>dParamFMax</FONT>,0.5f);</P>
<P>&nbsp;</P>
<P><FONT face=3DArial size=3D2>Is this a good way of setting up wheels =
so they=20
travel to a specified turn angle, and come back (fairly) smoothly? I'm =
getting=20
ALL sort of problems with the front wheels 'tripping over' themselves, =
and=20
stopping dead, so I'm wondering if I've got the horse before the cart. =
Anyone=20
got any input?</FONT></P></DIV></BODY></HTML>

------=_NextPart_000_00C6_01C33286.959F2FF0--