Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.

Dependencies:   mbed Watchdog SDFileSystem DigoleSerialDisp

Revision:
12:5dfa1ab47838
Parent:
2:fbc6e3cf3ed8
--- a/Sensors/Sensors.h	Thu Nov 29 16:35:31 2018 +0000
+++ b/Sensors/Sensors.h	Thu Nov 29 16:50:46 2018 +0000
@@ -32,12 +32,9 @@
 
 /** Sensor interface library abstracts sensor drivers, next step to a pluggable architecture */
 
-#include "Sirf3.h"
 #include "Ublox6.h"
-#include "Venus638flpx.h"
 #include "L3G4200D.h"
 #include "LSM303DLM.h"
-//#include "HMC5843.h"
 #include "IncrementalEncoder.h"
 #include "Matrix.h"
 
@@ -64,16 +61,12 @@
 //#define M_Z_MIN -573
 //#define M_Z_MAX 464
 
-// Chassis specific parameters
-#define WHEEL_STRIPES 32
-#define WHEEL_CIRC    0.321537 // m; calibrated with 4 12.236m runs. Wheel circumference measured 13.125" or 0.333375m
-#define WHEELBASE     0.290
-#define TRACK         0.280
-
 class Sensors {
 public:
     Sensors(void);
     void Compass_Calibrate(float offset[3], float scale[3]);
+    void configureEncoders(float tireCirc, int encStripes);
+    void setGyroScale(float scale);
     void Read_Encoders(void);
     void Read_Gyro(void);
     void Read_Accel(void);
@@ -117,7 +110,6 @@
     float rrEncSpeed;                       // right rear encoder speed
     float encDistance;                      // encoder distance since last check
     float encSpeed;                         // encoder calculated speed
-
     //Sirf3 gps;                              // Pharos SiRF III GPS
     //Venus638flpx gps;                       // Venus GPS
     Ublox6 gps;                             // Ublox6 GPS
@@ -133,6 +125,8 @@
 
 private:
     void BubbleSort(float *num, int numLength);
+    float _tireCirc;                        // tire circumference
+    int _encStripes;                        // encoder ticks per revolution
 };
 
-#endif
\ No newline at end of file
+#endif