the study of arithmetic

More
12 Apr 2013 09:05 #32609 by tianmen8008
:huh:

We want to use PUMA560 with EMC2-2.4.5,so we study the arithmetic about industry robot.
But we come upon a problem in file _posemath.c at functiong "pmMatRpyConvert".
The function in this file list as bellow:

int pmMatRpyConvert(PmRotationMatrix m, PmRpy * rpy)
{
rpy->p = atan2(-m.x.z, pmSqrt(pmSq(m.x.x) + pmSq(m.x.y)));
if (fabs(rpy->p - (2 * PM_PI)) < RPY_P_FUZZ) {
......
} else if (fabs(rpy->p + (2 * PM_PI)) < RPY_P_FUZZ) {
......
} else {
......
}
return pmErrno = 0;
}
we known atan2 is redifined in file
Rtapi_math_i386.h
"
extern __inline double atan2 (double __y, double __x) {
register long double __value;
__asm __volatile__ ("fpatan" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");
return __value;
}
"
But the value range of "atan2" and "fpatan" are (-PM_PI,PM_PI),
so the value range of "rpy->p" also is (-PM_PI,PM_PI),
then how can the programme run into the subarea of
"
if (fabs(rpy->p - (2 * PM_PI)) < RPY_P_FUZZ) {
......
}
"
also as
"
else if (fabs(rpy->p + (2 * PM_PI)) < RPY_P_FUZZ) {
......
}
"
thanks Fred Proctor.
thanks Will Shackleford.
thanks for your time.

Please Log in or Create an account to join the conversation.

Moderators: cncbasher
Time to create page: 0.056 seconds
Powered by Kunena Forum