[ODE] Steering A Vehicle (AMotors)

Nate W coding at natew.com
Mon Feb 17 20:21:02 2003


On Mon, 17 Feb 2003, Jeff Weber wrote:

> I agree, i'd prefer to not set it directly, but the only way to do the 
> steering with the Hinge2 joint that I could see was by using the dParamVel 
> and dParamFMax parameters.  At first glance, I didn't think this would work 
> well for taking input from a desk mounted steering wheel, but I guess it 
> could be made to work.
> 
> Has anyone done this before?

I've done similar stuff using a joystick to control regular hinges (and
sliders), and it works well.  Do something like:

dReal error = desired_angle - actual_angle
dVel = error * gain; // gain ~= 0.1
dJointSetXxxxParam (Joint, dParamVel, dVel);

You might need to tune the gain value a little bit, but 10% has almost
always worked for me.  If it's slow to respond, turn up the gain (or turn
up FMax if gain changes don't help); if it oscillates, turn down the gain.

-- 

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