This is some awesome robot code

Dependencies:   mbed-rtos mbed QEI

Fork of ICRSEurobot13 by Thomas Branch

Processes/Kalman/Kalman.h

Committer:
madcowswe
Date:
2013-04-09
Revision:
22:6e3218cf75f8
Parent:
21:167dacfe0b14
Child:
25:b16f1045108f

File content as of revision 22:6e3218cf75f8:

#ifndef KALMAN_H
#define KALMAN_H

//#include "globals.h"
#include "rtos.h"

namespace Kalman
{

typedef struct State {
    float x;
    float y;
    float theta;
} State ;

//Accessor function to get the state as one consistent struct
State getState();

//Main loops (to be attached as a thread in main)
void predictloop(void const*);
void updateloop(void const*);

void start_predict_ticker(Thread* predict_thread_ptr_in);

enum measurement_t {SONAR0 = 0, SONAR1, SONAR2, IR0, IR1, IR2};
const measurement_t maxmeasure = IR2;

//Call this to run an update
void runupdate(measurement_t type, float value, float variance);

extern float RawReadings[maxmeasure+1];
extern float IRphaseOffset;

extern bool Kalman_inited;

//Initialises the kalman filter
void KalmanInit();

}

#endif //KALMAN_H