2014 Eurobot fork

Dependencies:   mbed-rtos mbed QEI

Committer:
rsavitski
Date:
Tue Apr 09 20:37:59 2013 +0000
Revision:
24:50805ef8c499
Parent:
20:70d651156779
Child:
25:b16f1045108f
Motion control branch

Who changed what in which revision?

UserRevisionLine numberNew contents of line
madcowswe 16:52250d8d8fce 1 #ifndef KALMAN_H
madcowswe 16:52250d8d8fce 2 #define KALMAN_H
madcowswe 16:52250d8d8fce 3
rsavitski 24:50805ef8c499 4 #include "globals.h"
madcowswe 20:70d651156779 5 #include "rtos.h"
madcowswe 16:52250d8d8fce 6
madcowswe 16:52250d8d8fce 7 namespace Kalman
madcowswe 16:52250d8d8fce 8 {
madcowswe 16:52250d8d8fce 9
madcowswe 16:52250d8d8fce 10 //Accessor function to get the state as one consistent struct
madcowswe 20:70d651156779 11 State getState();
madcowswe 16:52250d8d8fce 12
madcowswe 16:52250d8d8fce 13 //Main loops (to be attached as a thread in main)
madcowswe 20:70d651156779 14 void predictloop(void const *dummy);
madcowswe 20:70d651156779 15 void updateloop(void const *dummy);
madcowswe 16:52250d8d8fce 16
madcowswe 20:70d651156779 17 void start_predict_ticker(Thread* predict_thread_ptr_in);
madcowswe 16:52250d8d8fce 18
madcowswe 16:52250d8d8fce 19 enum measurement_t {SONAR0 = 0, SONAR1, SONAR2, IR0, IR1, IR2};
madcowswe 19:4b993a9a156e 20 const measurement_t maxmeasure = IR2;
madcowswe 16:52250d8d8fce 21
madcowswe 16:52250d8d8fce 22 //Call this to run an update
madcowswe 16:52250d8d8fce 23 void runupdate(measurement_t type, float value, float variance);
madcowswe 16:52250d8d8fce 24
madcowswe 16:52250d8d8fce 25 extern float RawReadings[maxmeasure+1];
madcowswe 19:4b993a9a156e 26 extern float IRpahseOffset;
madcowswe 16:52250d8d8fce 27
madcowswe 20:70d651156779 28 extern bool Kalman_inited;
madcowswe 16:52250d8d8fce 29
madcowswe 16:52250d8d8fce 30 //Initialises the kalman filter
madcowswe 16:52250d8d8fce 31 void KalmanInit();
madcowswe 16:52250d8d8fce 32
madcowswe 16:52250d8d8fce 33 }
madcowswe 16:52250d8d8fce 34
madcowswe 16:52250d8d8fce 35 #endif //KALMAN_H