This is for our FYDP project. 2 MPU6050s are used

Dependencies:   Servo mbed

reckon/reckon.h

Committer:
majik
Date:
2015-03-22
Revision:
4:05484073a641
Parent:
0:21019d94ad33

File content as of revision 4:05484073a641:

#ifndef RECKON_H
#define RECKON_H

#include "mbed.h"
#include "ADNS5090.h"

//TODO: include a function to swap motors if they are connected wrong.

#define DEGREES(radians)((radians)*180/M_PI)

class Reckon
{
    public:
    
    ADNS5090&   optical_flow_L;
    ADNS5090&   optical_flow_R;    
    float r;
    
    float x;
    float y;
    float accX;
    float accY;
    float accZ;
    
    float flowX;
    float flowY;
    float flowYaw;
    float flow_dx_L;
    float flow_dx_R;
    float flow_dy_L;
    float flow_dy_R;
    float gyroYaw;
    
    Reckon(ADNS5090& L,ADNS5090& R, float radius);    
    
    static float reduce_angle( float &);
    
    float dest_angle(float x_dest, float y_dest);
    float dest_distance(float x_dest, float y_dest);
    
    bool updateOpticalFlow();               //new
    void reset();     
    
    private:    
    Timer frametime;
};

#endif