Only imu output
Fork of FYDP_Final2 by
reckon/reckon.h@0:21019d94ad33, 2015-03-21 (annotated)
- Committer:
- majik
- Date:
- Sat Mar 21 21:31:29 2015 +0000
- Revision:
- 0:21019d94ad33
Both IMUs work now
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
majik | 0:21019d94ad33 | 1 | #ifndef RECKON_H |
majik | 0:21019d94ad33 | 2 | #define RECKON_H |
majik | 0:21019d94ad33 | 3 | |
majik | 0:21019d94ad33 | 4 | #include "mbed.h" |
majik | 0:21019d94ad33 | 5 | #include "ADNS5090.h" |
majik | 0:21019d94ad33 | 6 | |
majik | 0:21019d94ad33 | 7 | //TODO: include a function to swap motors if they are connected wrong. |
majik | 0:21019d94ad33 | 8 | |
majik | 0:21019d94ad33 | 9 | #define DEGREES(radians)((radians)*180/M_PI) |
majik | 0:21019d94ad33 | 10 | |
majik | 0:21019d94ad33 | 11 | class Reckon |
majik | 0:21019d94ad33 | 12 | { |
majik | 0:21019d94ad33 | 13 | public: |
majik | 0:21019d94ad33 | 14 | |
majik | 0:21019d94ad33 | 15 | ADNS5090& optical_flow_L; |
majik | 0:21019d94ad33 | 16 | ADNS5090& optical_flow_R; |
majik | 0:21019d94ad33 | 17 | float r; |
majik | 0:21019d94ad33 | 18 | |
majik | 0:21019d94ad33 | 19 | float x; |
majik | 0:21019d94ad33 | 20 | float y; |
majik | 0:21019d94ad33 | 21 | float accX; |
majik | 0:21019d94ad33 | 22 | float accY; |
majik | 0:21019d94ad33 | 23 | float accZ; |
majik | 0:21019d94ad33 | 24 | |
majik | 0:21019d94ad33 | 25 | float flowX; |
majik | 0:21019d94ad33 | 26 | float flowY; |
majik | 0:21019d94ad33 | 27 | float flowYaw; |
majik | 0:21019d94ad33 | 28 | float flow_dx_L; |
majik | 0:21019d94ad33 | 29 | float flow_dx_R; |
majik | 0:21019d94ad33 | 30 | float flow_dy_L; |
majik | 0:21019d94ad33 | 31 | float flow_dy_R; |
majik | 0:21019d94ad33 | 32 | float gyroYaw; |
majik | 0:21019d94ad33 | 33 | |
majik | 0:21019d94ad33 | 34 | Reckon(ADNS5090& L,ADNS5090& R, float radius); |
majik | 0:21019d94ad33 | 35 | |
majik | 0:21019d94ad33 | 36 | static float reduce_angle( float &); |
majik | 0:21019d94ad33 | 37 | |
majik | 0:21019d94ad33 | 38 | float dest_angle(float x_dest, float y_dest); |
majik | 0:21019d94ad33 | 39 | float dest_distance(float x_dest, float y_dest); |
majik | 0:21019d94ad33 | 40 | |
majik | 0:21019d94ad33 | 41 | bool updateOpticalFlow(); //new |
majik | 0:21019d94ad33 | 42 | void reset(); |
majik | 0:21019d94ad33 | 43 | |
majik | 0:21019d94ad33 | 44 | private: |
majik | 0:21019d94ad33 | 45 | Timer frametime; |
majik | 0:21019d94ad33 | 46 | }; |
majik | 0:21019d94ad33 | 47 | |
majik | 0:21019d94ad33 | 48 | #endif |