![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ICRS Eurobot 2013
Dependencies: mbed mbed-rtos Servo QEI
supportfuncs.h@16:52250d8d8fce, 2013-04-07 (annotated)
- Committer:
- madcowswe
- Date:
- Sun Apr 07 16:50:36 2013 +0000
- Revision:
- 16:52250d8d8fce
- Child:
- 19:4b993a9a156e
Kalman init half done
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
madcowswe | 16:52250d8d8fce | 1 | #ifndef SUPPORTFUNCS_H |
madcowswe | 16:52250d8d8fce | 2 | #define SUPPORTFUNCS_H |
madcowswe | 16:52250d8d8fce | 3 | |
madcowswe | 16:52250d8d8fce | 4 | #define _USE_MATH_DEFINES |
madcowswe | 16:52250d8d8fce | 5 | #include <cmath> |
madcowswe | 16:52250d8d8fce | 6 | |
madcowswe | 16:52250d8d8fce | 7 | //Constrains agles to +/- pi |
madcowswe | 16:52250d8d8fce | 8 | inline float constrainAngle(float x){ |
madcowswe | 16:52250d8d8fce | 9 | x = fmod(x + M_PI, 2*M_PI); |
madcowswe | 16:52250d8d8fce | 10 | if (x < 0) |
madcowswe | 16:52250d8d8fce | 11 | x += 2*M_PI; |
madcowswe | 16:52250d8d8fce | 12 | return x - M_PI; |
madcowswe | 16:52250d8d8fce | 13 | } |
madcowswe | 16:52250d8d8fce | 14 | |
madcowswe | 16:52250d8d8fce | 15 | #endif //SUPPORTFUNCS_H |