[ODE] turning a buggy

Nate W coding at natew.com
Thu May 9 14:32:02 2002


On Thu, 9 May 2002, Home.se wrote:

> I would really appreciate if someone could take a look in my vehicle.cpp 
> (and maybe world.cpp) and see what im doing wrong.

I think you need to flesh out this loop a little bit:    :-)

vehicle.cpp:153
	// Turning
	for (i = 0; i < 2; i++)
	{
		// ???
	}

How about something like this code from test_buggy.cpp:

    // steering
    dReal v = steer - dJointGetHinge2Angle1 (joint[0]);
    if (v > 0.1) v = 0.1;
    if (v < -0.1) v = -0.1;
    v *= 10.0;
    dJointSetHinge2Param (joint[0],dParamVel,v);
    dJointSetHinge2Param (joint[0],dParamFMax,0.2);
    dJointSetHinge2Param (joint[0],dParamLoStop,-0.75);
    dJointSetHinge2Param (joint[0],dParamHiStop,0.75);
    dJointSetHinge2Param (joint[0],dParamFudgeFactor,0.1);

"steer" appears to be a dReal indicating the desired steering angle.

-- 

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