Clone per testare Mbed studio

Dependencies:   PwmIn IONMcMotor MPU6050 Eigen ROVER

Fork of Hyfliers_Completo_testato by Marco De Silva

Revision:
4:3f22193053d0
Parent:
3:fc26045926d9
Child:
6:584653235830
--- a/main.cpp	Wed Nov 06 10:57:51 2019 +0000
+++ b/main.cpp	Wed Jan 08 11:05:36 2020 +0000
@@ -6,7 +6,7 @@
 //#include "MX.h"
 //#include "UARTSerial_half.h"
 
-#define DEBUG false
+#define DEBUG true
 #define READ true 
 
  
@@ -34,9 +34,10 @@
     float vels_m = 0.0;    
     float vela_m = 0.0;
     
-    float vel_dx = 0.0;
-    float vel_sx = 0.0;    
-    float vel_r = 0.0;
+    float front_vel_dx = 0.0;
+    float front_vel_sx = 0.0;    
+    float retro_vel_dx = 0.0;
+    float retro_vel_sx = 0.0;
     float forward_vel = 0.0; 
     float pitch;
     
@@ -121,7 +122,7 @@
              
              timeReadPrec = time;             
              //rover.getRoverVelocity(velf_m, vels_m, vela_m, 0.125); 
-             rover.getRoverWheelsVelocity(vel_dx, vel_sx, vel_r); 
+             rover.getRoverWheelsVelocity(front_vel_dx, front_vel_sx, retro_vel_dx, retro_vel_sx); 
              
  
          }
@@ -130,7 +131,7 @@
          if(DEBUG && time - timePrintPrec > dtPrint){
              timePrintPrec = time;
               
-             //printf("Ts: %4.2f \t M2-M1 : %2.1f \r\n",dtPassedStab*1000,frontDistance);
+             printf("Ts: %4.2f \t M2-M1 : %2.1f \r\n",dtPassedStab*1000,frontDistance);
                
              //printf(" Ts: %4.2f \t Vfa: %4.4f \t Vfm %4.4f \t Vsa: %4.4f \t Vsm: %4.4f \t A: %4.4f \r\n",dtPassedStab*1000, velf_a, velf_m, vels_a, vels_m, amplitude);
 
@@ -148,7 +149,7 @@
              
 
          }
-          rover.ethComunicationUpdate(schedulerTimer.read(), pitch, frontDistance, retroDistance, dtPassedStab*1000, vel_r);
+          rover.ethComunicationUpdate(schedulerTimer.read(), pitch, frontDistance, retroDistance, dtPassedStab*1000, velf_a);
           //rover.ethComunicationUpdate(schedulerTimer.read(), pitch, velf_m, vels_m, dtPassedStab*1000, vel_r);