a

Dependencies:   mbed

Committer:
Jagang
Date:
Sun Dec 14 17:49:01 2014 +0000
Revision:
0:85567bbcebdb
New

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jagang 0:85567bbcebdb 1 #ifndef ODOMETRY_H
Jagang 0:85567bbcebdb 2 #define ODOMETRY_H
Jagang 0:85567bbcebdb 3
Jagang 0:85567bbcebdb 4 #include "mbed.h"
Jagang 0:85567bbcebdb 5 #include "QEI.h"
Jagang 0:85567bbcebdb 6
Jagang 0:85567bbcebdb 7 class Odometry
Jagang 0:85567bbcebdb 8 {
Jagang 0:85567bbcebdb 9 public:
Jagang 0:85567bbcebdb 10 Odometry(QEI *qei_left, QEI *qei_right, float radius_left, float radius_right, float v);
Jagang 0:85567bbcebdb 11
Jagang 0:85567bbcebdb 12 void setPos(float x, float y, float theta);
Jagang 0:85567bbcebdb 13 void setX(float x);
Jagang 0:85567bbcebdb 14 void setY(float Y);
Jagang 0:85567bbcebdb 15 void setTheta(float theta);
Jagang 0:85567bbcebdb 16
Jagang 0:85567bbcebdb 17 float getX() {return x;}
Jagang 0:85567bbcebdb 18 float getY() {return y;}
Jagang 0:85567bbcebdb 19 float getTheta() {return theta;}
Jagang 0:85567bbcebdb 20
Jagang 0:85567bbcebdb 21 void reset();
Jagang 0:85567bbcebdb 22
Jagang 0:85567bbcebdb 23 private:
Jagang 0:85567bbcebdb 24 QEI* m_qei_left;
Jagang 0:85567bbcebdb 25 int m_pulses_left;
Jagang 0:85567bbcebdb 26 QEI* m_qei_right;
Jagang 0:85567bbcebdb 27 int m_pulses_right;
Jagang 0:85567bbcebdb 28
Jagang 0:85567bbcebdb 29 float x, y, theta;
Jagang 0:85567bbcebdb 30
Jagang 0:85567bbcebdb 31 float m_radiusPerTick_left, m_radiusPerTick_right, m_v;
Jagang 0:85567bbcebdb 32
Jagang 0:85567bbcebdb 33 Ticker updater;
Jagang 0:85567bbcebdb 34
Jagang 0:85567bbcebdb 35 void update();
Jagang 0:85567bbcebdb 36 };
Jagang 0:85567bbcebdb 37
Jagang 0:85567bbcebdb 38 #endif