TRR2018 omar

Dependencies:   mbed

Fork of biniou by TRR 2018

Revision:
33:88d8f254c0b7
Parent:
30:21642fb8297a
Child:
34:c98fd59c690a
diff -r 21642fb8297a -r 88d8f254c0b7 stateMachines.cpp
--- a/stateMachines.cpp	Tue Sep 18 18:33:37 2018 +0000
+++ b/stateMachines.cpp	Tue Sep 18 20:40:06 2018 +0000
@@ -4,10 +4,15 @@
 #endif
 
 //*************** declarations ***************
+
+//time monitoring
 #ifdef DUMP_SAMPLIG_PERIOD
 Timer timerLog;
 #endif
 
+Timer timeSinceStart;// temps.start()/stop()/sec: read()/ms: read_ms()/µs: read_us()
+Timer timerSinceGetTachy;
+
 double distMurG90[NB_ECHANTILLONS_IR];//buffer tournant ir coté gauche pour moyenne
 double distMurD90[NB_ECHANTILLONS_IR];//buffer tournant ir coté droit pour moyenne
 double shortDistMurG90[NB_ECHANTILLONS_IR];//buffer tournant ir coté gauche petites distances pour moyenne
@@ -15,9 +20,9 @@
 double distMurG45[NB_ECHANTILLONS_IR];//buffer tournant ir avant gauche 45deg pour moyenne
 double distMurD45[NB_ECHANTILLONS_IR];//buffer tournant ir avant droit 45deg pour moyenne
 #ifdef DLVV
-uint16_t distMurG10[NB_ECHANTILLONS_IR];//buffer tournant ir avant gauche 10deg pour moyenne
-uint16_t distMurD10[NB_ECHANTILLONS_IR];//buffer tournant ir coté droit 10deg pour moyenne
-uint16_t distMurFront[NB_ECHANTILLONS_IR];//buffer tournant ir front
+double distMurG10[NB_ECHANTILLONS_IR];//buffer tournant ir avant gauche 10deg pour moyenne
+double distMurD10[NB_ECHANTILLONS_IR];//buffer tournant ir coté droit 10deg pour moyenne
+double distMurFront[NB_ECHANTILLONS_IR];//buffer tournant ir front
 #endif
 double distMurG90Moy;
 double distMurD90Moy;
@@ -112,11 +117,6 @@
 
 s_Section* p_sectionCourante = NULL;
 
-//time monitoring
-
-Timer timeSinceStart;// temps.start()/stop()/sec: read()/ms: read_ms()/µs: read_us()
-Timer timerSinceGetTachy;
-
 
 // +++++++++++++++++++++++++++++++++++++++++++ SAMPLING +++++++++++++++++++++++++++++++++++++++++++
 #ifdef SAMPLING
@@ -171,9 +171,9 @@
             history[indexSample].strLidar = strengthLidar;
             indexSample++;
 #if DEBUG > 0
-            pc.printf("\r\nodo:%d  dist = %d    \tstrength = %d    \tC45D: %d C45G: %d  C90D: %d  C90G: %d  looptime: %d micros",tachySectionDist_cm,distLidar,strengthLidar,distMurD45Moy,distMurG45Moy,distMurD90Moy,distMurG90Moy,timeSinceStart.read_us());// output signal strength value
+            pc.printf("\r\nodo:%d  dist = %d    \tstrength = %.4ld    \tC45D: %.4lf C45G: %.4lf  C90D: %.4lf  C90G: %.4lf  looptime: %d micros",tachySectionDist_cm,distLidar,strengthLidar,distMurD45Moy,distMurG45Moy,distMurD90Moy,distMurG90Moy,timeSinceStart.read_us());// output signal strength value
             pc.printf("\r\nstate Murs: %d, state Section %d, state MaxSpeed %d, state Throttle %d\r\n",st_murs,st_currentSection,st_maxSpeed,st_thro);
-            //wait(2);
+            wait(2);
             timeSinceStart.reset();
             timeSinceStart.start();
 #endif