Cooper Liu
/
Eurobot2013_Co-Processor
working version with calibration done
Fork of Eurobot2013 by
Embed:
(wiki syntax)
Show/hide line numbers
geometryfuncs.h
00001 #ifndef GEOMETRYFUNCS_H 00002 #define GEOMETRYFUNCS_H 00003 00004 // rectifies angle to range -PI to PI 00005 template <typename T> 00006 T rectifyAng (T ang_in) { 00007 ang_in -= (floor(ang_in/(2*PI)))*2*PI; 00008 if (ang_in < -PI) { 00009 ang_in += 2*PI; 00010 } 00011 if (ang_in > PI) { 00012 ang_in -= 2*PI; 00013 } 00014 00015 return ang_in; 00016 } 00017 00018 #endif //GEOMETRYFUNCS_H
Generated on Tue Jul 12 2022 18:53:25 by 1.7.2