Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
Diff: globals.h
- Revision:
- 9:377560539b74
- Parent:
- 5:7ac07bf30707
- Child:
- 10:294b9adbc9d3
diff -r ffc7d8af2d5a -r 377560539b74 globals.h --- a/globals.h Fri Apr 27 18:36:54 2012 +0000 +++ b/globals.h Sat Apr 28 17:21:24 2012 +0000 @@ -1,42 +1,44 @@ #ifndef GLOBALS_H #define GLOBALS_H +#include "mbed.h" +#define PI 3.14159265 + //#define ROBOT_SECONDARY -#ifndef ROBOT_SECONDARY -#define ROBOT_PRIMARY -// invert echo polarity for primary -#define SONAR_ECHO_INV -// Primary Robot constants -const int robot_width = 410; -const int encoderRevCount = 1856; -const int wheelmm = 314; -const int robotCircumference = 1256; -#else +#ifdef ROBOT_SECONDARY //Secondary Robot constants in mm const int robot_width = 260; const int encoderRevCount = 360; const int wheelmm = 226; const int robotCircumference = 816; -#endif - -#include "mbed.h" - -#define PI 3.14159265 +#else +#define ROBOT_PRIMARY +// invert echo polarity for primary +#define SONAR_ECHO_INV +// Primary Robot constants +const int robot_width = 390; +const int encoderRevCount = 1856; +const int wheelmm = 304; +const int robotCircumference = 1150; +#endif //Robot movement constants -const float fwdvarperunit = 0.005; //1 std dev = 7% //NEEDS TO BE MEASURED AGAIN! -const float varperang = 3E-5; //around 1 degree stddev per 180 turn -const float xyvarpertime = 0.001; //(very poorly) accounts for hitting things +const float fwdvarperunit = 0.008; //1 std dev = 7% //NEEDS TO BE MEASURED AGAIN! +const float varperang = 0.005; //around 1 degree stddev per 180 turn +const float xyvarpertime = 0.0005; //(very poorly) accounts for hitting things const float angvarpertime = 0.001; //sonar constants static const float sonarvariance = 0.005; +//IR constants +static const float IRvariance = 0.001; + //Arena constants struct pos { int x; @@ -64,7 +66,7 @@ #define ANGLE_TOR 0.15 // motion control -#define MOVE_SPEED 30 +#define MOVE_SPEED 50 #define MAX_STEP_RATIO 0.10 //maximum change in the speed //#define TRACK_RATE 10 // +- rate for each wheel when tracking