a
Dependencies: mbed
Diff: Odometry/Odometry.h
- Revision:
- 0:85567bbcebdb
diff -r 000000000000 -r 85567bbcebdb Odometry/Odometry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Odometry/Odometry.h Sun Dec 14 17:49:01 2014 +0000 @@ -0,0 +1,38 @@ +#ifndef ODOMETRY_H +#define ODOMETRY_H + +#include "mbed.h" +#include "QEI.h" + +class Odometry +{ + public: + Odometry(QEI *qei_left, QEI *qei_right, float radius_left, float radius_right, float v); + + void setPos(float x, float y, float theta); + void setX(float x); + void setY(float Y); + void setTheta(float theta); + + float getX() {return x;} + float getY() {return y;} + float getTheta() {return theta;} + + void reset(); + + private: + QEI* m_qei_left; + int m_pulses_left; + QEI* m_qei_right; + int m_pulses_right; + + float x, y, theta; + + float m_radiusPerTick_left, m_radiusPerTick_right, m_v; + + Ticker updater; + + void update(); +}; + +#endif