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:
Wed Jan 20 18:39:31 2016 +0000
Parent:
23:3a34b8b70da6
Commit message:
Ca marche pas trop trop mal, on a toujours l'erreur sur le d?placement, mais au moins ?a peut vaguement se d?placer;

Changed in this revision

Map/Map.cpp Show annotated file Show diff for this revision Revisions of this file
Map/Obstacles/Obs_circle.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	Wed Jan 20 16:06:36 2016 +0000
+++ b/Map/Map.cpp	Wed Jan 20 18:39:31 2016 +0000
@@ -69,7 +69,7 @@
     obstacles.push_back(new Obs_circle(ROBOTRADIUS,IDO_P13,1750,3000-90,30));// P13
     obstacles.push_back(new Obs_circle(ROBOTRADIUS,IDO_P14,1850,3000-90,30));// P14
     obstacles.push_back(new Obs_circle(ROBOTRADIUS,IDO_P15,1770,3000-1100,30));// P15*/
-    obstacles.push_back(new Obs_circle(ROBOTRADIUS,IDO_P16,700,1000,1));// P16
+    obstacles.push_back(new Obs_circle(ROBOTRADIUS,IDO_P16,700,1000,20));// P16
 }
 
 int Map::getHeight(float x, float y)
--- a/Map/Obstacles/Obs_circle.h	Wed Jan 20 16:06:36 2016 +0000
+++ b/Map/Obstacles/Obs_circle.h	Wed Jan 20 18:39:31 2016 +0000
@@ -6,8 +6,6 @@
 class Obs_circle: public Obstacle
 {
     public:
-        /** Definit un obstacle de la forme d'un cercle 
-          * @param
         Obs_circle(float robotRadius, int id, float x, float y, float size);
         virtual int height(float x, float y);
         
--- a/main.cpp	Wed Jan 20 16:06:36 2016 +0000
+++ b/main.cpp	Wed Jan 20 18:39:31 2016 +0000
@@ -44,13 +44,21 @@
     init();
     //Construction des obstacles
     map.build();
-    map.AStar(0, 1000, 2000, 1000, 100);
+    map.AStar(odo.getX(), odo.getY(), 1400, 1000, 100);
     path = map.path;
     
     for(int i=0; i<path.size();i++) {
         odo.GotoXYT(path[i].x, path[i].y, 0);
     }
         
+        
+    map.AStar(odo.getX(), odo.getY(), 200, 1000, 100);
+    path = map.path;
+    
+    for(int i=0; i<path.size();i++) {
+        odo.GotoXYT(path[i].x, path[i].y, PI);
+    }
+    
     //odo.GotoXYT(500, 50, 0);
     //odo.GotoXYT(200, 0, 0);
     //odo.GotoXYT(0, 0, 0);
@@ -67,7 +75,7 @@
     pc.printf("Hello from main !\n\r");
     wait_ms(500);
     
-    odo.setPos(0, 0, 0);
+    odo.setPos(0, 1000, 0);
     roboclaw.ForwardM1(ADR, 0);
     roboclaw.ForwardM2(ADR, 0);