Robot's source code
Dependencies: mbed
Odometry/Odometry.h@0:41149573d577, 2014-09-28 (annotated)
- Committer:
- Jagang
- Date:
- Sun Sep 28 19:53:31 2014 +0000
- Revision:
- 0:41149573d577
- Child:
- 1:c8dc3dee3b70
- Child:
- 30:33e970ba1fe5
New
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jagang | 0:41149573d577 | 1 | #ifndef ODOMETRY_H |
Jagang | 0:41149573d577 | 2 | #define ODOMETRY_H |
Jagang | 0:41149573d577 | 3 | |
Jagang | 0:41149573d577 | 4 | #include "mbed.h" |
Jagang | 0:41149573d577 | 5 | #include "QEI.h" |
Jagang | 0:41149573d577 | 6 | |
Jagang | 0:41149573d577 | 7 | class Odometry |
Jagang | 0:41149573d577 | 8 | { |
Jagang | 0:41149573d577 | 9 | public: |
Jagang | 0:41149573d577 | 10 | Odometry(QEI *qei_left, QEI *qei_right, float radius_left, float radius_right, float v); |
Jagang | 0:41149573d577 | 11 | |
Jagang | 0:41149573d577 | 12 | void setPos(float x, float y, float theta); |
Jagang | 0:41149573d577 | 13 | void setX(float x); |
Jagang | 0:41149573d577 | 14 | void setY(float Y); |
Jagang | 0:41149573d577 | 15 | void setTheta(float theta); |
Jagang | 0:41149573d577 | 16 | |
Jagang | 0:41149573d577 | 17 | float getX() {return x;} |
Jagang | 0:41149573d577 | 18 | float getY() {return y;} |
Jagang | 0:41149573d577 | 19 | float getTheta() {return theta;} |
Jagang | 0:41149573d577 | 20 | |
Jagang | 0:41149573d577 | 21 | void reset(); |
Jagang | 0:41149573d577 | 22 | |
Jagang | 0:41149573d577 | 23 | private: |
Jagang | 0:41149573d577 | 24 | QEI* m_qei_left; |
Jagang | 0:41149573d577 | 25 | int m_pulses_left; |
Jagang | 0:41149573d577 | 26 | QEI* m_qei_right; |
Jagang | 0:41149573d577 | 27 | int m_pulses_right; |
Jagang | 0:41149573d577 | 28 | |
Jagang | 0:41149573d577 | 29 | float x, y, theta; |
Jagang | 0:41149573d577 | 30 | |
Jagang | 0:41149573d577 | 31 | float m_radiusPerTick_left, m_radiusPerTick_right, m_v; |
Jagang | 0:41149573d577 | 32 | |
Jagang | 0:41149573d577 | 33 | Ticker updater; |
Jagang | 0:41149573d577 | 34 | |
Jagang | 0:41149573d577 | 35 | void update(); |
Jagang | 0:41149573d577 | 36 | }; |
Jagang | 0:41149573d577 | 37 | |
Jagang | 0:41149573d577 | 38 | #endif |