![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ICRS Eurobot 2013
Dependencies: mbed mbed-rtos Servo QEI
supportfuncs.h@19:4b993a9a156e, 2013-04-07 (annotated)
- Committer:
- madcowswe
- Date:
- Sun Apr 07 19:26:07 2013 +0000
- Revision:
- 19:4b993a9a156e
- Parent:
- 16:52250d8d8fce
- Child:
- 20:70d651156779
Kalman init almost ready for testing
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 | #include <cmath> |
madcowswe | 19:4b993a9a156e | 5 | #include "globals.h" |
madcowswe | 19:4b993a9a156e | 6 | |
madcowswe | 16:52250d8d8fce | 7 | |
madcowswe | 16:52250d8d8fce | 8 | //Constrains agles to +/- pi |
madcowswe | 16:52250d8d8fce | 9 | inline float constrainAngle(float x){ |
madcowswe | 19:4b993a9a156e | 10 | x = fmod(x + PI, 2*PI); |
madcowswe | 16:52250d8d8fce | 11 | if (x < 0) |
madcowswe | 19:4b993a9a156e | 12 | x += 2*PI; |
madcowswe | 19:4b993a9a156e | 13 | return x - PI; |
madcowswe | 16:52250d8d8fce | 14 | } |
madcowswe | 16:52250d8d8fce | 15 | |
madcowswe | 16:52250d8d8fce | 16 | #endif //SUPPORTFUNCS_H |