Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
globals.h@0:f3bf6c7e2283, 2012-04-20 (annotated)
- Committer:
- narshu
- Date:
- Fri Apr 20 20:39:35 2012 +0000
- Revision:
- 0:f3bf6c7e2283
- Child:
- 1:bbabbd997d21
inverted sonar echo input at pin14 and pin15
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
narshu | 0:f3bf6c7e2283 | 1 | #ifndef GLOBALS_H |
narshu | 0:f3bf6c7e2283 | 2 | #define GLOBALS_H |
narshu | 0:f3bf6c7e2283 | 3 | |
narshu | 0:f3bf6c7e2283 | 4 | #include "mbed.h" |
narshu | 0:f3bf6c7e2283 | 5 | |
narshu | 0:f3bf6c7e2283 | 6 | #define PI 3.14159265 |
narshu | 0:f3bf6c7e2283 | 7 | |
narshu | 0:f3bf6c7e2283 | 8 | //Robot constants |
narshu | 0:f3bf6c7e2283 | 9 | //const int encoderRevCount = 1856; |
narshu | 0:f3bf6c7e2283 | 10 | //const int wheelmm = 314; |
narshu | 0:f3bf6c7e2283 | 11 | //const int robotCircumference = 1256; |
narshu | 0:f3bf6c7e2283 | 12 | |
narshu | 0:f3bf6c7e2283 | 13 | //Robot constants in mm |
narshu | 0:f3bf6c7e2283 | 14 | const int robot_width = 260; |
narshu | 0:f3bf6c7e2283 | 15 | const int encoderRevCount = 360; |
narshu | 0:f3bf6c7e2283 | 16 | const int wheelmm = 226; |
narshu | 0:f3bf6c7e2283 | 17 | const int robotCircumference = 816; |
narshu | 0:f3bf6c7e2283 | 18 | |
narshu | 0:f3bf6c7e2283 | 19 | //Arena constants |
narshu | 0:f3bf6c7e2283 | 20 | struct pos { |
narshu | 0:f3bf6c7e2283 | 21 | int x; |
narshu | 0:f3bf6c7e2283 | 22 | int y; |
narshu | 0:f3bf6c7e2283 | 23 | }; |
narshu | 0:f3bf6c7e2283 | 24 | const pos beaconpos[] = {{3000, 1000},{0,0}, {0,2000}}; |
narshu | 0:f3bf6c7e2283 | 25 | |
narshu | 0:f3bf6c7e2283 | 26 | //sonar constants |
narshu | 0:f3bf6c7e2283 | 27 | static const float sonarvariance = 0.004; |
narshu | 0:f3bf6c7e2283 | 28 | |
narshu | 0:f3bf6c7e2283 | 29 | //High speed serial port |
narshu | 0:f3bf6c7e2283 | 30 | extern Serial pc; |
narshu | 0:f3bf6c7e2283 | 31 | |
narshu | 0:f3bf6c7e2283 | 32 | //I2C mutex |
narshu | 0:f3bf6c7e2283 | 33 | //extern Mutex i2c_rlock; |
narshu | 0:f3bf6c7e2283 | 34 | //extern Mutex i2c_wlock; |
narshu | 0:f3bf6c7e2283 | 35 | |
narshu | 0:f3bf6c7e2283 | 36 | |
narshu | 0:f3bf6c7e2283 | 37 | // IR angle calc |
narshu | 0:f3bf6c7e2283 | 38 | #define RELI_BOUND_LOW 4 |
narshu | 0:f3bf6c7e2283 | 39 | #define RELI_BOUND_HIGH 25 |
narshu | 0:f3bf6c7e2283 | 40 | |
narshu | 0:f3bf6c7e2283 | 41 | // Localization estimate torrelences |
narshu | 0:f3bf6c7e2283 | 42 | #define POSITION_TOR 80 |
narshu | 0:f3bf6c7e2283 | 43 | #define ANGLE_TOR 0.15 |
narshu | 0:f3bf6c7e2283 | 44 | |
narshu | 0:f3bf6c7e2283 | 45 | // motion control |
narshu | 0:f3bf6c7e2283 | 46 | #define ROTA_SPEED 40 |
narshu | 0:f3bf6c7e2283 | 47 | #define MOVE_SPEED 50 |
narshu | 0:f3bf6c7e2283 | 48 | #define MAX_STEP_RATIO 0.10 //maximum change in the speed |
narshu | 0:f3bf6c7e2283 | 49 | //#define TRACK_RATE 10 // +- rate for each wheel when tracking |
narshu | 0:f3bf6c7e2283 | 50 | |
narshu | 0:f3bf6c7e2283 | 51 | // Task suspend periods |
narshu | 0:f3bf6c7e2283 | 52 | #define IR_TURRET_PERIOD 200 |
narshu | 0:f3bf6c7e2283 | 53 | #define MOTION_UPDATE_PERIOD 20 |
narshu | 0:f3bf6c7e2283 | 54 | |
narshu | 0:f3bf6c7e2283 | 55 | |
narshu | 0:f3bf6c7e2283 | 56 | |
narshu | 0:f3bf6c7e2283 | 57 | #endif |