Robot's source code

Dependencies:   mbed

Revision:
56:eb0600022463
Parent:
55:2d75c0a0375b
Child:
57:ab13f4e7a2b2
Child:
58:a3718a53d946
--- a/main.cpp	Thu Apr 09 14:07:14 2015 +0000
+++ b/main.cpp	Thu Apr 09 15:54:43 2015 +0000
@@ -8,7 +8,7 @@
 
 
 #include "Odometry.h"
-#include "Asserv.h"
+//#include "Asserv.h"
 #include "Motor.h"
 /*----------------------------------------------------------------------------------------------*/
 /*Serial*/    
@@ -102,10 +102,10 @@
     bool testOdo = false;
     
     
-    Asserv<float> instanceAsserv(&odometry);
+    //Asserv<float> instanceAsserv(&odometry);
     
     /*----------------------------------------------------------------------------------------------*/
-    instanceAsserv.setGoal( (float)0,(float)0, (float)PI/2);        
+    //instanceAsserv.setGoal( (float)0,(float)0, (float)PI/2);        
     
     while(!testOdo)
     {       
@@ -113,11 +113,11 @@
         
         t.start();
         
-        instanceAsserv.update((float)t.read());        
-        Mat<float> X( instanceAsserv.getX() );        
-        float phi_r = (float)instanceAsserv.getPhiR();
-        float phi_l = (float)instanceAsserv.getPhiL();
-        float phi_max = (float)instanceAsserv.getPhiMax();        
+        //instanceAsserv.update((float)t.read());        
+        //Mat<float> X( instanceAsserv.getX() );        
+        //float phi_r = (float)instanceAsserv.getPhiR();
+        //float phi_l = (float)instanceAsserv.getPhiL();
+        //float phi_max = (float)instanceAsserv.getPhiMax();        
         //logger.printf(" x : %f ;\t y : %f ;\t theta : %f ;\t VD = %f ;\t W = %f \n\r",X.get(1,1),X.get(2,1),X.get(3,1), X.get(4,1), X.get(5,1) );
         //logger.printf(" x : %f ;\t y : %f ;\t theta : %f ",X.get(1,1),X.get(2,1),X.get(3,1) );
         
@@ -132,8 +132,8 @@
         //blue.printf("Odometry : \n\r");
         //z.afficherMblue();  
         
-        motorR.setSpeed(0.08+(phi_r/phi_max) );
-        motorL.setSpeed(0.06+(phi_l/phi_max) );     
+        //motorR.setSpeed(0.08+(phi_r/phi_max) );
+        //motorL.setSpeed(0.06+(phi_l/phi_max) );     
         
         //Timer Handling :
         t.stop();        
@@ -143,7 +143,7 @@
     }
         
     
-    int i=0;
+    /*int i=0;
     int nbrech = 100;
     float tableR[nbrech], tableL[nbrech];
     
@@ -172,5 +172,5 @@
             wait(1);
             i++;
         }
-    }
+    }*/
 }