ICRS Eurobot 2013
Dependencies: mbed mbed-rtos Servo QEI
Diff: supportfuncs.h
- Revision:
- 19:4b993a9a156e
- Parent:
- 16:52250d8d8fce
- Child:
- 20:70d651156779
--- a/supportfuncs.h Sun Apr 07 17:51:59 2013 +0000 +++ b/supportfuncs.h Sun Apr 07 19:26:07 2013 +0000 @@ -1,15 +1,16 @@ #ifndef SUPPORTFUNCS_H #define SUPPORTFUNCS_H -#define _USE_MATH_DEFINES #include <cmath> +#include "globals.h" + //Constrains agles to +/- pi inline float constrainAngle(float x){ - x = fmod(x + M_PI, 2*M_PI); + x = fmod(x + PI, 2*PI); if (x < 0) - x += 2*M_PI; - return x - M_PI; + x += 2*PI; + return x - PI; } #endif //SUPPORTFUNCS_H \ No newline at end of file