[ODE] getting negative angle?

Neelam C tina_vipul at yahoo.com
Tue Nov 9 14:52:51 MST 2004


Well, I do check that my angles dont go beyond the low and high limits, isnt
that enough? If not then why does my other angles (thats are positive desired
angles) work perfectly well.

        if (J3 <kJoint.getLowStop()){
                J3 = kJoint.getLowStop();
        }
        else{
           if (J3 > kJoint.getHighStop()){
                J3 = kJoint.getHighStop();
           }

Regards.


--- Bo Morgan <neptune at MIT.EDU> wrote:

> 
> With angle controllers like this I usually make sure that my angle error
> is between PI and -PI.
> 
> If you add something like:
> 
>   while(angle_error > PI)
>     angle_error -= 2*PI;
> 
>   while(angle_error < -PI)
>     angle_error += 2*PI;
> 
> Would that help?
> 
> Bo
> 
> On Tue, 9 Nov 2004, Neelam C wrote:
> 
> )
> ) Hi all,
> )
> ) How do we get a desired negative angle?
> ) eg:
> ) desired angle = -1.898
> ) actual angle = -0.0045
> )
> ) my code goes as
> )
> ) jointError = desired angle - actual angle;
> ) jointRate = dJointGetHingeAngleRate(jointID);
> ) maxForce = +1200;
> ) pValue = 0.6; dValue 0.1;
> ) needVelocity = (pValue*jointError - dValue*jointRate);
> ) dJointSetHingeParam(kJoint.jointID,     dParamFMax,             maxForce);
> ) dJointSetHingeParam(kJoint.jointID,     dParamVel,             
> needVelocity);
> )
> ) This works very well if I want positive angle but when my desired angle is
> ) negative this sucks!
> )
> ) Regards.
> )
> ) =====
> ) ________________________
> ) Neelam C
> )
> ) http://www.geocities.com/tina_vipul/homepage.html
> )
> )
> )
> ) __________________________________
> ) Do you Yahoo!?
> ) Check out the new Yahoo! Front Page.
> ) www.yahoo.com
> )
> )
> ) _______________________________________________
> ) ODE mailing list
> ) ODE at q12.org
> ) http://q12.org/mailman/listinfo/ode
> )
> 


=====
________________________
Neelam C

http://www.geocities.com/tina_vipul/homepage.html


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 



More information about the ODE mailing list