Oskar Weigl
/
Eurobot2013
We are going to win! wohoo
globals.h@9:08552997b544, 2012-11-14 (annotated)
- Committer:
- madcowswe
- Date:
- Wed Nov 14 17:15:53 2012 +0000
- Revision:
- 9:08552997b544
- Parent:
- 7:88753d0ad4ca
Added an important comment
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sv | 1:6799c07fe510 | 1 | #ifndef GLOBALS_H |
sv | 1:6799c07fe510 | 2 | #define GLOBALS_H |
sv | 1:6799c07fe510 | 3 | |
madcowswe | 7:88753d0ad4ca | 4 | |
madcowswe | 7:88753d0ad4ca | 5 | #define ROBOT_PRIMARY |
madcowswe | 7:88753d0ad4ca | 6 | |
madcowswe | 7:88753d0ad4ca | 7 | |
sv | 1:6799c07fe510 | 8 | #include "mbed.h" |
sv | 1:6799c07fe510 | 9 | #define PI 3.14159265 |
sv | 1:6799c07fe510 | 10 | |
sv | 1:6799c07fe510 | 11 | //enables ui |
sv | 1:6799c07fe510 | 12 | //#define UION |
sv | 1:6799c07fe510 | 13 | |
sv | 1:6799c07fe510 | 14 | |
sv | 1:6799c07fe510 | 15 | |
madcowswe | 7:88753d0ad4ca | 16 | #ifdef ROBOT_PRIMARY |
madcowswe | 7:88753d0ad4ca | 17 | // Primary defs go here |
sv | 1:6799c07fe510 | 18 | #else |
madcowswe | 7:88753d0ad4ca | 19 | // Secondary defs go here |
sv | 1:6799c07fe510 | 20 | #endif |
sv | 1:6799c07fe510 | 21 | |
madcowswe | 7:88753d0ad4ca | 22 | //Robot hardware parameters |
madcowswe | 7:88753d0ad4ca | 23 | const int robotCircumference = 816; //mm (DUMMY!) |
sv | 1:6799c07fe510 | 24 | |
sv | 1:6799c07fe510 | 25 | //Robot movement constants |
sv | 1:6799c07fe510 | 26 | const float fwdvarperunit = 0.01; //1 std dev = 7% //NEEDS TO BE MEASURED AGAIN! |
sv | 1:6799c07fe510 | 27 | const float varperang = 0.01; //around 1 degree stddev per 180 turn |
sv | 1:6799c07fe510 | 28 | const float xyvarpertime = 0.0005; //(very poorly) accounts for hitting things |
sv | 1:6799c07fe510 | 29 | const float angvarpertime = 0.001; |
sv | 1:6799c07fe510 | 30 | |
sv | 1:6799c07fe510 | 31 | //sonar constants |
sv | 1:6799c07fe510 | 32 | static const float sonarvariance = 0.005; |
sv | 1:6799c07fe510 | 33 | |
sv | 1:6799c07fe510 | 34 | //IR constants |
sv | 1:6799c07fe510 | 35 | static const float IRvariance = 0.001; |
sv | 1:6799c07fe510 | 36 | |
sv | 1:6799c07fe510 | 37 | //Arena constants |
sv | 1:6799c07fe510 | 38 | struct pos { |
sv | 1:6799c07fe510 | 39 | int x; |
sv | 1:6799c07fe510 | 40 | int y; |
sv | 1:6799c07fe510 | 41 | }; |
sv | 1:6799c07fe510 | 42 | |
sv | 1:6799c07fe510 | 43 | //beacon positions |
sv | 1:6799c07fe510 | 44 | extern pos beaconpos[]; |
sv | 1:6799c07fe510 | 45 | |
sv | 1:6799c07fe510 | 46 | //Colour |
sv | 1:6799c07fe510 | 47 | extern bool Colour; // 1 for red, 0 for blue |
sv | 1:6799c07fe510 | 48 | |
sv | 1:6799c07fe510 | 49 | //System constants |
sv | 1:6799c07fe510 | 50 | const int PREDICTPERIOD = 20; //ms |
sv | 1:6799c07fe510 | 51 | |
sv | 1:6799c07fe510 | 52 | //High speed serial port |
sv | 1:6799c07fe510 | 53 | extern Serial pc; |
sv | 1:6799c07fe510 | 54 | |
sv | 1:6799c07fe510 | 55 | |
sv | 1:6799c07fe510 | 56 | #endif |