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