[ODE] RE: Wheel rotation problem

McEvoy, Nick nick.mcevoy at dsto.defence.gov.au
Thu Sep 12 16:54:02 2002


Marco Grubert wrote:
>My observations is that mass of the connected objects has a huge impact on
>stability. I started out with a 500kg chassis and 15kg wheels. Reducing
this
>to 1/10th of the original value significantly improved the top speed when
>wheel bending occurs. It appears as though the object mass would increase
>with higher speed, pushing the wheels into a /\ shape when driving straight
>or a // shape when doing a left turn.

// Chassis
CLength = 0.7f;
CWidth = 0.5f;
CHeight = 0.2f;
CMass = 1.0f;

// Wheels
WRadius = 0.15f;
WMass = 0.2f;

Gravity=-5.0f; // yes a strange value but who said my game is on earth :)

I'll do some more parameter tweaking. :)


>I have not yet tried moving the hinge2
>anchor points around- does that make any difference?

No I have not tried that idea yet.


>I did not notice any difference when setting the finite rotation mode.
>However, the documentation suggests setting the axis every timestep (which
>you don´t do in the sample code).

I see that in the doco ... NOW ... missed it before ... so
dBodySetFiniteRotationAxis() should be call each step !?  I'll try that
then.


>I don´t quite understand how this mode
>operates or why the axis has to be reset. Why should it change during
>iterations ?

Yes good question (why call each time step) ... I don't understand it either
... I'm no physics guru. :-(


>How are you adjusting the axes´ angles? I had this problem when only
>querying one wheel, calculating the difference and then applying the same
>value to both joints. Calculating the rate of change independently for each
>of the two front joints fixed that problem.

Ahhh your right on this one I think ... I was calculating each wheel
(steering) independently.  I'll fix it this weekend.

// Motor
for (i = 0; i <= 1; i++)
{
	dJointSetHinge2Param(mODEJoint[i], dParamVel2, -speed);
	dJointSetHinge2Param(mODEJoint[i], dParamFMax2, 0.1);
}

// Steering - woops this is wrong ... I'll fix it as per your suggestion !!!
for (i = 0; i <= 1; i++)
{
	dReal v = steer - dJointGetHinge2Angle1(mODEJoint[i]);
	if (v > 0.1) v = 0.1;
	if (v < -0.1) v = -0.1;
	v *= 10.0;
	dJointSetHinge2Param(mODEJoint[i], dParamVel, v);
	dJointSetHinge2Param(mODEJoint[i], dParamFMax, 0.2);
	dJointSetHinge2Param(mODEJoint[i], dParamLoStop, -0.75);
	dJointSetHinge2Param(mODEJoint[i], dParamHiStop, 0.75);
	dJointSetHinge2Param(mODEJoint[i], dParamFudgeFactor, 0.1);
}

Thanks for your help !

Regards,
Nick