ARES / Mbed 2 deprecated RobotMain2015

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Odometry.h Source File

Odometry.h

00001 #ifndef ODOMETRY_H
00002 #define ODOMETRY_H
00003 
00004 #include "mbed.h"
00005 #include "QEI.h"
00006 
00007 class Odometry
00008 {
00009     public:
00010         Odometry(QEI *qei_left, QEI *qei_right, float radius_left, float radius_right, float v);
00011         
00012         void setPos(float x, float y, float theta);
00013         void setX(float x);
00014         void setY(float Y);
00015         void setTheta(float theta);
00016         
00017         float getX() {return x;}
00018         float getY() {return y;}
00019         float getTheta() {return theta;}
00020         
00021         void reset();
00022     
00023     private:
00024         QEI* m_qei_left;
00025         int m_pulses_left;
00026         QEI* m_qei_right;
00027         int m_pulses_right;
00028         
00029         float x, y, theta;
00030         
00031         float m_radiusPerTick_left, m_radiusPerTick_right, m_v;
00032         
00033         Ticker updater;
00034         
00035         void update();
00036 };
00037 
00038 #endif