[ODE] Angle problems -180 to +180 ????

Tyler Streeter tylerstreeter at gmail.com
Mon Mar 21 09:52:42 MST 2005


I'm guessing that when the joint reaches its limit, it gets confused
because -180 and +180 are the same angle.  If it has a desired angle
of -180, when it hits -180 (approached from the -179 side), it might
interpret that as +180.  Then, since it still has a desired angle of
-180, it will continue spinning in the same direction until it reaches
-180 again.  You probably just need to limit your range to something
like -179.9 to +179.9.

Also, note that the angle for axis 1 of the amotor must not get
outside the range -pi/2 to pi/2.

Tyler


On Fri, 18 Mar 2005 15:16:19 -0000, Chris Royce <ode at croyce.co.uk> wrote:
>  
> Hello there, 
>   
> It appears that the angle range for my joints runs from -180 to +180. I have
> no idea why this is but it works fine except then the joint is required to
> go from -180 to +180 or vice versa when I use an amotor to move it. 
>   
> When I provide 180 or -180 as the desired angle it gets stuck in a loop and
> just rotates about its axis and doesn't stop :(. 
>   
> Have i missed something ? 
>   
> BTW
> jointCtl is just an array with the desired angle in 
> joints[i] is the array of joints 
>   
>   
> for(i=(LIMBS-2); i>=0; i--)
> {
>  dReal v0 = toRadians(jointCtl[i]) - dJointGetHingeAngle
> (joints[i].getLimbJoint());
>  if (v0 > 0.001) v0 = 0.01;
>  else if (v0 < -0.001) v0 = -0.01;
>  
>  v0 *= 2.5; 
>   
>  dJointSetAMotorParam (joints[i].getLimbMotor(),dParamVel2,v0);
>  dJointSetAMotorParam (joints[i].getLimbMotor(),dParamFMax2,30.0);
>  dJointSetAMotorParam (joints[i].getLimbMotor(),dParamFudgeFactor2,0.001);
> } 
>   
>   
> Thanks for any help 
>   
> Cheers 
> 
> Chris 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 
>


More information about the ODE mailing list