[ODE] bad wheels

THD apt at home.se
Thu Feb 10 22:19:05 MST 2005


hello, I've got problems with my vehicle-steering in ODE

My vehicle is a box with 4 spheres as wheels (hinge2-jointed), it's
driving on a trimesh. My problem is steering. Sometimes the left wheel
locks steering full left, sometimes the wheels steer in different
direction, also problem increases when I drive faster. 

As you see beneath I ty to solve it setting dParamLoStop/dParamHiStop,
but it doesn't seem to help...

 This piece of code is called every frame: 
(m_isSteering is a bool checking if the steering keys are down, m_steer
is float that increases if I press the steering keys.)


if(m_isSteering == false) 
{ 
  m_steer = 0.0f; 
  dJointSetHinge2Param (wheel1id, dParamLoStop, 0); 
  dJointSetHinge2Param (wheel1id, dParamHiStop, 0); 
  dJointSetHinge2Param (wheel2id, dParamLoStop, 0); 
  dJointSetHinge2Param (wheel2id, dParamHiStop, 0); 
} 
else 
{ 
  dReal v = m_steer - dJointGetHinge2Angle1(wheel1id); 
  if (v > 0.1f) 
    v = 0.1f; 
  if (v < -0.1f) 
    v = -0.1f; 
  v *= 10.0f; 

  dJointSetHinge2Param (wheel1id, dParamVel, v); 
  dJointSetHinge2Param (wheel1id, dParamFMax, 0.2f); 
  dJointSetHinge2Param (wheel1id, dParamLoStop, -0.5f); 
  dJointSetHinge2Param (wheel1id, dParamHiStop, 0.5f); 
  dJointSetHinge2Param (wheel1id, dParamFudgeFactor, 0.1f); 

  dJointSetHinge2Param (wheel2id, dParamVel, v); 
  dJointSetHinge2Param (wheel2id, dParamFMax, 0.2f); 
  dJointSetHinge2Param (wheel2id, dParamLoStop, -0.5f); 
  dJointSetHinge2Param (wheel2id, dParamHiStop, 0.5f); 
  dJointSetHinge2Param (wheel2id, dParamFudgeFactor, 0.1f); 
} 


Shouldn't this work? 
Anyone who got any better steering-"algoritm" or suggestion?

	/Sepultang


More information about the ODE mailing list