![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
We are going to win! wohoo
Diff: globals.h
- Revision:
- 7:88753d0ad4ca
- Parent:
- 1:6799c07fe510
diff -r 5a52c046d8f7 -r 88753d0ad4ca globals.h --- a/globals.h Wed Nov 14 16:49:10 2012 +0000 +++ b/globals.h Wed Nov 14 17:11:12 2012 +0000 @@ -1,35 +1,26 @@ #ifndef GLOBALS_H #define GLOBALS_H + +#define ROBOT_PRIMARY + + #include "mbed.h" #define PI 3.14159265 - -//#define ROBOT_SECONDARY - //enables ui //#define UION -#ifdef ROBOT_SECONDARY -//Secondary Robot constants in mm -const int robot_width = 260; -const int encoderRevCount = 360; -const int wheelmm = 229; -const int robotCircumference = 816; +#ifdef ROBOT_PRIMARY +// Primary defs go here #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 = 308; -const int robotCircumference = 1150; +// Secondary defs go here #endif - +//Robot hardware parameters +const int robotCircumference = 816; //mm (DUMMY!) //Robot movement constants const float fwdvarperunit = 0.01; //1 std dev = 7% //NEEDS TO BE MEASURED AGAIN! @@ -61,39 +52,5 @@ //High speed serial port extern Serial pc; -//I2C mutex -//extern Mutex i2c_rlock; -//extern Mutex i2c_wlock; - - -// IR angle calc -#define RELI_BOUND_LOW 4 -#define RELI_BOUND_HIGH 25 - -// Movement target tolerances -#define POSITION_TOR 20 // in mm -#define ANGLE_TOR 0.06 // in rad - -// motion control - -#ifndef MOVE_SPEED_DEF -#define MOVE_SPEED_DEF -static int MOVE_SPEED = 35; -#endif - -#define MAX_STEP_RATIO 0.10 //maximum change in the speed -//#define TRACK_RATE 10 // +- rate for each wheel when tracking - -#ifdef ROBOT_PRIMARY -#define FWD_MOVE_P 20//18 -#define SPIN_MOVE_P 7//5.8 -#else -#define FWD_MOVE_P 3.2 -#define SPIN_MOVE_P 4 -#endif - -// Task suspend periods -#define IR_TURRET_PERIOD 200 -#define MOTION_UPDATE_PERIOD 20 #endif \ No newline at end of file