Code for our FYDP -only one IMU works right now -RTOS is working
Embed:
(wiki syntax)
Show/hide line numbers
reckon.h
00001 #ifndef RECKON_H 00002 #define RECKON_H 00003 00004 #include "mbed.h" 00005 #include "ADNS5090.h" 00006 00007 //TODO: include a function to swap motors if they are connected wrong. 00008 00009 #define DEGREES(radians)((radians)*180/M_PI) 00010 00011 class Reckon 00012 { 00013 public: 00014 00015 ADNS5090& optical_flow_L; 00016 ADNS5090& optical_flow_R; 00017 float r; 00018 00019 float x; 00020 float y; 00021 float accX; 00022 float accY; 00023 float accZ; 00024 00025 float flowX; 00026 float flowY; 00027 float flowYaw; 00028 float flow_dx_L; 00029 float flow_dx_R; 00030 float flow_dy_L; 00031 float flow_dy_R; 00032 float gyroYaw; 00033 00034 Reckon(ADNS5090& L,ADNS5090& R, float radius); 00035 00036 static float reduce_angle( float &); 00037 00038 float dest_angle(float x_dest, float y_dest); 00039 float dest_distance(float x_dest, float y_dest); 00040 00041 bool updateOpticalFlow(); //new 00042 void reset(); 00043 00044 private: 00045 Timer frametime; 00046 }; 00047 00048 #endif
Generated on Wed Jul 13 2022 10:32:23 by 1.7.2