Robot's source code

Dependencies:   mbed

Revision:
22:80fdb12c167f
Parent:
21:5443f93819db
Child:
23:228317fe0457
--- a/main.cpp	Sun Dec 14 17:31:52 2014 +0000
+++ b/main.cpp	Sun Dec 14 18:03:34 2014 +0000
@@ -2,13 +2,10 @@
 #include "QEI.h"
 #include "Odometry.h"
 #include <iostream>
-#include "Map.h"
-
 
 /*---------------------------------------------------------------------------------------------------------*/
 /*---------------------------------------------------------------------------------------------------------*/
 /*KalmanFilter*/
-
 #include "EKF.h"
 Mat<double> motion_bicycle3( Mat<double> state, Mat<double> command, double dt = 0.5);
 Mat<double> sensor_bicycle3( Mat<double> state, Mat<double> command, Mat<double> d_state, double dt = 0.5 );
@@ -27,10 +24,6 @@
     Serial pcs(USBTX, USBRX); // tx, rx
 /*----------------------------------------------------------------------------------------------*/
 
-/* --- Initialisation de la liste des obstable --- */
-int Obstacle::lastId = 0;
-
-
 int main()
 {
 
@@ -161,7 +154,7 @@
         double phi_max = 100;                    
         
         instance.computeCommand(dX, (double)dt, -2);        
-        pcs.printf("command : \n phi_r = %f \n phi_l = %f \n", phi_r/phi_max*100, phi_l/phi_max*100);
+        pcs.printf("command : \n phi_r = %f \n phi_l = %f \n", (phi_r/phi_max)*100, (phi_l/phi_max)*100);
         //instance.getX().afficher();
         
         
@@ -176,12 +169,12 @@
             dir2.write(1);
             
         if(abs(phi_r/phi_max) < 1.0)
-            setPWM(&pw1, (float)abs(phi_r/phi_max));
+            setPWM(&pw1, (float)abs((double)phi_r/phi_max));
         else
             cout << "P1..." << endl;
             
         if(abs(phi_l/phi_max) < 1.0)
-            setPWM(&pw2,(float)abs(phi_l/phi_max));
+            setPWM(&pw2,(float)abs((double)phi_l/phi_max));
         else
             pcs.printf("P2...");