Closed TanhuanHUST closed 4 years ago
set: angleA = -M_Pi angleB = M_PI
YAW_P2P(angleA - angleB) = -6.28318548
but the correct answer is 0;
That is how define works. Define is not a function, it will simply replace what you provide.
YAW(angleA-angleB) will be replaced as std::fmod((angleA-angleB+M_PI), 2*M_PI) - M_PI in the compliation.
You can add a pair of paretheses around "angle" as (angle)+M_PI.
I want to figure out : ans = std::fmod((-M_PI - M_PI +M_PI), 2*M_PI) ; the value of ans is -MPI in windows visual studio 2017 . so i think YAW(yaw) cant convert yaw_ belong to [-pi,pi];
set: angleA = -M_Pi angleB = M_PI
YAW_P2P(angleA - angleB) = -6.28318548
but the correct answer is 0;