Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Odometry.h
00001 #ifndef ODOMETRY2_H 00002 #define ODOMETRY2_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;} // ]-PI;PI] 00020 00021 float getVitLeft() {return m_vitLeft;} 00022 float getVitRight() {return m_vitRight;} 00023 00024 float getDistLeft() {return m_distLeft;} 00025 float getDistRight() {return m_distRight;} 00026 00027 void setDistLeft(float dist) {m_distLeft = dist;} 00028 void setDistRight(float dist) {m_distRight = dist;} 00029 00030 void update(float dt); 00031 00032 int getPulsesLeft(void) {return m_pulses_left;} 00033 int getPulsesRight(void) {return m_pulses_right;} 00034 00035 private: 00036 QEI* m_qei_left; 00037 int m_pulses_left; 00038 QEI* m_qei_right; 00039 int m_pulses_right; 00040 00041 float x, y, theta; 00042 float m_vitLeft, m_vitRight; 00043 float m_distLeft, m_distRight; 00044 00045 float m_distPerTick_left, m_distPerTick_right, m_v; 00046 }; 00047 00048 #endif
Generated on Wed Jul 13 2022 04:59:28 by
1.7.2

