Robot's source code

Dependencies:   mbed

Revision:
71:95d76c181b22
Child:
72:b2a128486332
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Odometry/Odometry2.h	Fri Apr 10 18:01:54 2015 +0000
@@ -0,0 +1,38 @@
+#ifndef ODOMETRY2_H
+#define ODOMETRY2_H
+
+#include "mbed.h"
+#include "QEI.h"
+
+class Odometry2
+{
+    public:
+        Odometry2(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;}
+        
+        float getVitLeft() {return m_vitLeft;}
+        float getVitRight() {return m_vitRight;}
+        
+        void update(float dt);
+    
+    private:
+        QEI* m_qei_left;
+        int m_pulses_left;
+        QEI* m_qei_right;
+        int m_pulses_right;
+        
+        float x, y, theta;
+        float m_vitLeft, m_vitRight;
+        
+        float m_distPerTick_left, m_distPerTick_right, m_v;
+};
+
+#endif