Colour sensors calibrated
Dependencies: mbed-rtos mbed Servo QEI
Fork of ICRSEurobot13 by
supportfuncs.h@17:6263e90bf3ba, 2013-04-07 (annotated)
- Committer:
- madcowswe
- Date:
- Sun Apr 07 17:51:59 2013 +0000
- Revision:
- 17:6263e90bf3ba
- Parent:
- 16:52250d8d8fce
- Child:
- 19:4b993a9a156e
Still fixing init in kalman
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 |