Time is good

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Files at this revision

API Documentation at this revision

Comitter:
IceTeam
Date:
Thu May 05 00:41:18 2016 +0000
Parent:
67:244bc1cc6678
Child:
69:1b257fb65281
Commit message:
Correction bugs;

Changed in this revision

Map/map.cpp Show annotated file Show diff for this revision Revisions of this file
Map/map.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Map/map.cpp	Thu May 05 02:11:25 2016 +0200
+++ b/Map/map.cpp	Thu May 05 00:41:18 2016 +0000
@@ -3,6 +3,7 @@
 /* Dernier Changement : Romain 20h30 */
 
 void map::Build_Objectives() {
+    logger.printf("map::Build_Objectives Creation des Objectifs ...\n\r");
     if (couleur == VERT) {
         addObj (objectif (OBJ_BLOC, 120, 1000, 0, Codo, Parasol, pince));
         addObj (objectif (OBJ_BLOC, 120, 1000, 0, Codo, Parasol, pince, 10));
@@ -53,7 +54,6 @@
     
     pointParcours depP (dep, NULL, arr);
     int indTMP1=0;  // Le point actuel
-    int PointEnding = 0;    
     open.push_back (depP);
 
     while (!ended && !open.empty ()) {
@@ -193,8 +193,10 @@
 }
 
 void map::Execute(int obj) {
+    objectif o = objectifs[obj];
+    logger.printf("map::Execute(int obj) Realisation de l'objectif %d\n\r", obj);
+    logger.printf("Depart [%f, %f] Objectif [%f, %f]", Codo->getX(), Codo->getY(), o.getX(), o.getY());
     // logger.printf("Findway %f-%f -> %f-%f\n\r", Codo->getX(), Codo->getY(), XObjectif, YObjectif);
-    objectif o = objectifs[obj];
     FindWay (Codo->getX(), Codo->getY(), o.getX(), o.getY());
     
     if (endedParc) {
@@ -218,11 +220,13 @@
 
 void map::Execute() {
     for (int i = 0; i < objectifs.size();++i) {
+        logger.printf("map::Execute() Realisation de l'objectif %d", i);
         Execute(i);
     }
 }
 
 void map::Build () {
+    logger.printf("map::Build Creation des obstacles ...\n\r");
     if (couleur == VERT) {
         max_x_table = 1400;
         max_y_table = 1900;
@@ -270,6 +274,7 @@
 }
 
 void map::Build_formation_1 (int couleur) {
+    logger.printf("map::Build_formation1 Ajout des coquillages de la formation 1 ...\n\r");
     if (couleur == VERT) {
         addObs(obsCarr (200, 2000-450, 40, 40));    // Coquillage du haut - droite
         addObs(obsCarr (200, 2000-750, 40, 40));    // Coquillage sur le même axe horizontal
--- a/Map/map.h	Thu May 05 02:11:25 2016 +0200
+++ b/Map/map.h	Thu May 05 00:41:18 2016 +0000
@@ -16,7 +16,7 @@
 #include "../../StepperMotor/Stepper.h"
 
 #define X_START_VERT 110
-#define X_START_VIOLET 2990
+#define X_START_VIOLET 2890
 #define Y_START 1000
 
 class map {
--- a/main.cpp	Thu May 05 02:11:25 2016 +0200
+++ b/main.cpp	Thu May 05 00:41:18 2016 +0000
@@ -98,11 +98,14 @@
     logger.baud(9600);
     logger.printf("Hello from main !\n\r");
 
-    ControlleurPince.home();
+    controlleurPince.home();
     
     //depart();
     init_interrupt();
     wait_ms(1);
+    while (CAMP == 0);
+    while (CAMP == 1);
+    
     //while(START==0);
     logger.printf("End init\n\r");
 }