Robot's source code
Dependencies: mbed
Map/Objectifs/Objectif.h@119:c45efcd706d9, 2015-05-06 (annotated)
- Committer:
- Jagang
- Date:
- Wed May 06 15:17:16 2015 +0000
- Revision:
- 119:c45efcd706d9
- Parent:
- 117:f8c147141a0c
- Child:
- 123:55e5e9acc541
Modif asserv B; Impl?mentation de l'IA et des objectifs (Ramasser PC et d?poser)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jagang | 109:53918ba98306 | 1 | #ifndef OBJECTIF_H |
Jagang | 109:53918ba98306 | 2 | #define OBJECTIF_H |
Jagang | 109:53918ba98306 | 3 | |
Jagang | 109:53918ba98306 | 4 | #include "defines.h" |
Jagang | 109:53918ba98306 | 5 | |
Jagang | 109:53918ba98306 | 6 | #ifdef PLAN_A |
Jagang | 109:53918ba98306 | 7 | #include "Asserv.h" |
Jagang | 109:53918ba98306 | 8 | #else |
Jagang | 109:53918ba98306 | 9 | #include "planB.h" |
Jagang | 109:53918ba98306 | 10 | #endif |
Jagang | 109:53918ba98306 | 11 | |
Jagang | 109:53918ba98306 | 12 | enum ID |
Jagang | 109:53918ba98306 | 13 | { |
Jagang | 117:f8c147141a0c | 14 | IDO_PC1, |
Jagang | 119:c45efcd706d9 | 15 | IDO_PC2, |
Jagang | 117:f8c147141a0c | 16 | IDO_DEPOT |
Jagang | 109:53918ba98306 | 17 | }; |
Jagang | 109:53918ba98306 | 18 | |
Jagang | 109:53918ba98306 | 19 | class Objectif |
Jagang | 109:53918ba98306 | 20 | { |
Jagang | 109:53918ba98306 | 21 | public: |
Jagang | 117:f8c147141a0c | 22 | Objectif(float x, float y, float theta); |
Jagang | 109:53918ba98306 | 23 | |
Jagang | 109:53918ba98306 | 24 | virtual void run() = 0; |
Jagang | 109:53918ba98306 | 25 | bool isDone(){return done;} |
Jagang | 109:53918ba98306 | 26 | float getX(){return x;} |
Jagang | 109:53918ba98306 | 27 | float getY(){return y;} |
Jagang | 109:53918ba98306 | 28 | float getTheta(){return theta;} |
Jagang | 109:53918ba98306 | 29 | |
Jagang | 109:53918ba98306 | 30 | int getId(){return id;} |
Jagang | 109:53918ba98306 | 31 | void setId(int id){this->id = id;} |
Jagang | 109:53918ba98306 | 32 | |
Jagang | 109:53918ba98306 | 33 | virtual int isActive(){return active;} |
Jagang | 109:53918ba98306 | 34 | void activate(){active=true;} |
Jagang | 109:53918ba98306 | 35 | void desactivate(){active=false;} |
Jagang | 109:53918ba98306 | 36 | protected: |
Jagang | 109:53918ba98306 | 37 | float x,y,theta; |
Jagang | 109:53918ba98306 | 38 | bool done,active; |
Jagang | 109:53918ba98306 | 39 | int id; |
Jagang | 109:53918ba98306 | 40 | }; |
Jagang | 109:53918ba98306 | 41 | |
Jagang | 109:53918ba98306 | 42 | #endif |