Eurobot_2012_Secondary

Dependencies:   mbed tvmet

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers globals.h Source File

globals.h

00001 #ifndef GLOBALS_H
00002 #define GLOBALS_H
00003 
00004 #include "mbed.h"
00005 
00006 #define PI 3.14159265
00007 
00008 //Robot constants
00009 //const int encoderRevCount = 1856;
00010 //const int wheelmm = 314;
00011 //const int robotCircumference = 1256;
00012 
00013 //Robot constants in mm
00014 const int robot_width = 260;
00015 const int encoderRevCount = 360;
00016 const int wheelmm = 226;
00017 const int robotCircumference = 816;
00018 
00019 //Robot movement constants
00020 const float fwdvarperunit = 0.005; //1 std dev = 7% //NEEDS TO BE MEASURED AGAIN!
00021 const float varperang = 3E-5; //around 1 degree stddev per 180 turn
00022 const float xyvarpertime = 0.001; //(very poorly) accounts for hitting things
00023 const float angvarpertime = 0.001;
00024 
00025 //sonar constants
00026 static const float sonarvariance = 0.005;
00027 
00028 //Arena constants
00029 struct pos {
00030     int x;
00031     int y;
00032 };
00033 const pos beaconpos[] = {{3000, 1000},{0,0}, {0,2000}};
00034 
00035 //System constants
00036 const int PREDICTPERIOD = 20; //ms
00037 
00038 //High speed serial port
00039 extern Serial pc;
00040 
00041 //I2C mutex
00042 //extern Mutex i2c_rlock;
00043 //extern Mutex i2c_wlock;
00044 
00045 
00046 // IR angle calc
00047 #define RELI_BOUND_LOW          4
00048 #define RELI_BOUND_HIGH         25
00049 
00050 // Localization estimate tolerences
00051 #define POSITION_TOR            50
00052 #define ANGLE_TOR               0.15
00053 
00054 // motion control
00055 #define MOVE_SPEED              30
00056 #define MAX_STEP_RATIO          0.10 //maximum change in the speed
00057 //#define TRACK_RATE              10       // +- rate for each wheel when tracking
00058 
00059 // Task suspend periods
00060 #define IR_TURRET_PERIOD        200
00061 #define MOTION_UPDATE_PERIOD    20
00062 
00063 #endif