2014 Eurobot fork

Dependencies:   mbed-rtos mbed QEI

Committer:
madcowswe
Date:
Fri Apr 12 17:03:53 2013 +0000
Revision:
48:254b124cef02
Parent:
33:a49197572737
Online phase offset estimation, not working

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 21:167dacfe0b14 14 void predictloop(void const*);
madcowswe 21:167dacfe0b14 15 void updateloop(void const*);
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 16:52250d8d8fce 26
madcowswe 20:70d651156779 27 extern bool Kalman_inited;
madcowswe 16:52250d8d8fce 28
madcowswe 16:52250d8d8fce 29 //Initialises the kalman filter
madcowswe 16:52250d8d8fce 30 void KalmanInit();
madcowswe 16:52250d8d8fce 31
madcowswe 16:52250d8d8fce 32 }
madcowswe 16:52250d8d8fce 33
madcowswe 16:52250d8d8fce 34 #endif //KALMAN_H