Robot's source code
Dependencies: mbed
Diff: Map/Objectifs/Obj_pince.cpp
- Revision:
- 123:55e5e9acc541
- Parent:
- 119:c45efcd706d9
--- a/Map/Objectifs/Obj_pince.cpp Thu May 07 14:18:07 2015 +0000 +++ b/Map/Objectifs/Obj_pince.cpp Mon May 11 20:32:11 2015 +0000 @@ -1,5 +1,6 @@ #include "Obj_pince.h" #include <vector> +#include "Map.h" #ifdef PLAN_A extern Asserv<float> asserv; @@ -9,6 +10,7 @@ extern Odometry2 odometry; extern std::vector<Objectif*> objectifs; +extern Map terrain; Obj_pince::Obj_pince(float x, float y, float xp, float yp, float theta, AX12 *ax12_pince) :Objectif(x,y,theta) @@ -30,12 +32,21 @@ for(unsigned int i=0;i < objectifs.size();i++) { - if(objectifs[i]->getId() == IDO_DEPOT && !objectifs[i]->isDone()) + if(IDO_PC1 <= id && id <= IDO_PC4 && objectifs[i]->getId() == IDO_DEPOT_PC && !objectifs[i]->isDone()) + { + objectifs[i]->activate(); + break; + } + if(IDO_P1 <= id && id <= IDO_P16 && objectifs[i]->getId() == IDO_DEPOT_P && !objectifs[i]->isDone()) { objectifs[i]->activate(); break; } } + + for(unsigned int i=0;i < terrain.obstacles.size();i++) + if(id == terrain.obstacles[i]->getId()) + terrain.obstacles[i]->desactivate(); } int Obj_pince::isActive()