Robot's source code
Dependencies: mbed
Diff: Odometry/Odometry.h
- Revision:
- 89:d05001d85a02
- Parent:
- 63:fd9af0693e50
--- a/Odometry/Odometry.h Sat Apr 18 08:40:24 2015 +0000 +++ b/Odometry/Odometry.h Thu Apr 23 16:29:31 2015 +0000 @@ -4,6 +4,8 @@ #include "mbed.h" #include "QEI.h" +extern Serial logger; + class Odometry { public: @@ -27,13 +29,15 @@ float getW() {return W;} float getPhiright() { - phi_r = (m_distPerTick_right/radius_right)*(delta_right/dt); + phi_r = (m_distPerTick_right/radius_right)*(delta_right/dt); + //logger.printf("phi r = %f \r\n", phi_r); return phi_r; } float getPhileft() { - phi_l = (m_distPerTick_left/radius_left)*(delta_left/dt); + phi_l = (m_distPerTick_left/radius_left)*(delta_left/dt); + //logger.printf("phi = %f \r\n", phi_l); return phi_l; } @@ -52,13 +56,13 @@ float radius_left; float radius_right; - float x, y, theta; - float m_vitLeft, m_vitRight; - float offsetVx, offsetVy; + volatile float x, y, theta; + volatile float m_vitLeft, m_vitRight; + volatile float offsetVx, offsetVy; bool initoffset; - float Vx,Vy,W; - float phi_r,phi_l; - float dt; + volatile float Vx,Vy,W; + volatile float phi_r,phi_l; + volatile float dt; Timer timer; float m_distPerTick_left, m_distPerTick_right, m_v;