Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Timer by
Revision 52:98f8a6ccb6ae, committed 2016-05-03
- Comitter:
- IceTeam
- Date:
- Tue May 03 12:37:31 2016 +0000
- Parent:
- 50:2dea82393beb
- Child:
- 53:bef06d5e827d
- Commit message:
- Debut ajout obstacle;
Changed in this revision
--- a/Map/map.cpp Mon May 02 08:35:56 2016 +0000
+++ b/Map/map.cpp Tue May 03 12:37:31 2016 +0000
@@ -3,6 +3,42 @@
map::map (Odometry* nodo) : Codo(nodo) {
}
+void map::Build (int start_type) {
+ m.addObs(obsCarr (800, 100, 100, 15));
+ m.addObs(obsCarr (2200, 100, 100, 15));
+
+ m.addObs(obsCarr (1500, 750, 1100, 15));
+ m.addObs(obsCarr (1500, 1050, 20, 300));
+
+ if (start_type == MAP_RIGHTSIDE) {
+ m.addObs(obsCarr (0, 2000, 250, 150)); // Coté haut droite
+ m.addObs(obsCarr (200, 2000, 200, 50));
+
+ m.addObs(obsCarr (3000, 2000, 250, 150)); // Coté bas droite
+ m.addObs(obsCarr (2800, 2000, 200, 50));
+
+ m.addObs(obsCarr (200, 2000-450, 40, 40)); // Coquillages du haut droit
+ m.addObs(obsCarr (200, 2000-750, 40, 40));
+
+ m.addObs(obsCarr (900, 2000-550, 40, 40));
+ m.addObs(obsCarr (1200, 2000-350, 40, 40)); // Coquillages du milieu/haut
+
+ m.addObs(obsCarr (1500, 2000-550, 40, 40));
+ m.addObs(obsCarr (1500, 2000-350, 40, 40));
+
+ m.addObs(obsCarr (3000-900, 2000-550, 40, 40));
+ m.addObs(obsCarr (3000-1200, 2000-350, 40, 40));
+
+ m.addObs(obsCarr (3000-200, 2000-450, 40, 40)); // Coquillages du bas droite
+ m.addObs(obsCarr (3000-200, 2000-750, 40, 40));
+ }
+ else {
+ m.addObs(obsCarr (1250, 1000, 220, 220));
+ m.addObs(obsCarr (1500, 750, 220, 220));
+ m.addObs(obsCarr (1500, 1250, 220, 220));
+ }
+}
+
void map::addObs (obsCarr nobs) {
obs.push_back (nobs);
}
--- a/Map/map.h Mon May 02 08:35:56 2016 +0000
+++ b/Map/map.h Tue May 03 12:37:31 2016 +0000
@@ -7,6 +7,9 @@
#include "controle.h"
#include "Odometry.h"
+#define MAP_RIGHTSIDE 1
+#define MAP_LEFTSIDE 2
+
class map {
public:
map (Odometry* nodo);
@@ -14,6 +17,7 @@
void FindWay (point dep, point arr);
void FindWay (float depX, float depY, float arrX, float arrY);
void Execute (float XObjectif, float YObjectif);
+ void Build(int start_type);
nVector<pointParcours>& getParc () { return path; }
bool& getEnded () { return endedParc; }
--- a/main.cpp Mon May 02 08:35:56 2016 +0000
+++ b/main.cpp Tue May 03 12:37:31 2016 +0000
@@ -56,11 +56,9 @@
{
init();
+ int cote = MAP_RIGHTSIDE;
/*map m(&odo);
- m.addObs(obsCarr (1250, 1000, 220, 220));
- m.addObs(obsCarr (1500, 750, 220, 220));
- m.addObs(obsCarr (1500, 1250, 220, 220));
-
+ m.Build(cote);
m.Execute(1000,1000);
m.Execute(1500,1000);
m.Execute(1500,1500);
