Robot's source code

Dependencies:   mbed

Revision:
47:4909e97570f6
Parent:
33:eab29f01e499
Child:
48:cb3ebbc27db3
--- a/Odometry/Odometry.h	Tue Mar 24 09:17:11 2015 +0000
+++ b/Odometry/Odometry.h	Thu Mar 26 18:04:23 2015 +0000
@@ -11,6 +11,7 @@
         
         void setPos(float x, float y, float theta);
         void setVit(float Vx, float Vy, float W);
+        void setVitPhi(float phi_r, float phi_l);
         void setX(float x);
         void setY(float Y);
         void setTheta(float theta);
@@ -24,15 +25,33 @@
         float getVx()   {return Vx;}
         float getVy()   {return Vy;}
         float getW()   {return W;}
+        float getPhiright()
+        {
+            phi_r = (m_distPerTick_right/radius_right)*(delta_right/dt);
+            return phi_r;
+        }
+        
+        float getPhileft() 
+        {
+            phi_l = (m_distPerTick_left/radius_left)*(delta_left/dt);
+            return phi_l;
+        }
     
     private:
         QEI* m_qei_left;
         int m_pulses_left;
         QEI* m_qei_right;
         int m_pulses_right;
+        int delta_right;
+        int delta_left;
+        float radius_left;
+        float radius_right;
         
         float x, y, theta;
+        float offsetVx, offsetVy;
+        bool initoffset;
         float Vx,Vy,W;
+        float phi_r,phi_l;
         float dt;
         Timer timer;