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 01:52:34 2016 +0200
Parent:
64:24e1057a97f7
Child:
66:47353c8122de
Commit message:
Tentative de correction du bug / Changement du init !

Changed in this revision

Map/map.cpp Show annotated file Show diff for this revision Revisions of this file
Odometry/Odometry.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 01:30:14 2016 +0200
+++ b/Map/map.cpp	Thu May 05 01:52:34 2016 +0200
@@ -203,6 +203,7 @@
             // logger.printf("Goto %d/%d [%f, %f]... \n\r", i, path.size()-1, path[i].getX(), path[i].getY());
             //the = (float) atan2((double) (p[i].gety() - odo.getY()), (double) (p[i].getx() - odo.getX())); 
             Codo->GotoXY((double)path[i].getX(), (double)path[i].getY());
+            Codo->Stop();
             // logger.printf("Goto Fini\n\r");
         }
         Codo->GotoThet(o.getThet());
--- a/Odometry/Odometry.h	Thu May 05 01:30:14 2016 +0200
+++ b/Odometry/Odometry.h	Thu May 05 01:52:34 2016 +0200
@@ -108,6 +108,10 @@
     double carre(double a) {
         return a*a;
     }
+    void Stop {
+        roboclaw.ForwardM1(0);
+        roboclaw.ForwardM2(0);
+    }
     
     void getEnc();
     
--- a/main.cpp	Thu May 05 01:30:14 2016 +0200
+++ b/main.cpp	Thu May 05 01:52:34 2016 +0200
@@ -62,6 +62,7 @@
 /* Debut du programme */
 int main(void)
 {
+    init();
     map m(&odo, NULL, controlleurPince, VERT, 1);
     m.Build();
     m.Execute(1);
@@ -103,17 +104,11 @@
     SCouleur = VERT;
     LEDV = 1;
     LEDR = 0;
-
-    odo.setPos(110, 1000, 0);
-    roboclaw.ResetEnc();
-    roboclaw.ForwardM1(0);
-    roboclaw.ForwardM2(0);
-    wait_ms(500);
-    while(1);
+    
     //depart();
     init_interrupt();
-    wait_ms(100);
-    while(START==0);
+    wait_ms(1);
+    //while(START==0);
     logger.printf("End init\n\r");
 }