Robot's source code

Dependencies:   mbed

Committer:
Jagang
Date:
Tue May 05 16:35:53 2015 +0000
Revision:
109:53918ba98306
Child:
117:f8c147141a0c
IA

Who changed what in which revision?

UserRevisionLine numberNew 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 109:53918ba98306 14
Jagang 109:53918ba98306 15 };
Jagang 109:53918ba98306 16
Jagang 109:53918ba98306 17 class Objectif
Jagang 109:53918ba98306 18 {
Jagang 109:53918ba98306 19 public:
Jagang 109:53918ba98306 20 #ifdef PLAN_A
Jagang 109:53918ba98306 21 Objectif(float x, float y, float theta, Asserv<float> *asserv);
Jagang 109:53918ba98306 22 #else
Jagang 109:53918ba98306 23 Objectif(float x, float y, float theta, aserv_planB *asserv);
Jagang 109:53918ba98306 24 #endif
Jagang 109:53918ba98306 25
Jagang 109:53918ba98306 26 virtual void run() = 0;
Jagang 109:53918ba98306 27 bool isDone(){return done;}
Jagang 109:53918ba98306 28 float getX(){return x;}
Jagang 109:53918ba98306 29 float getY(){return y;}
Jagang 109:53918ba98306 30 float getTheta(){return theta;}
Jagang 109:53918ba98306 31
Jagang 109:53918ba98306 32 int getId(){return id;}
Jagang 109:53918ba98306 33 void setId(int id){this->id = id;}
Jagang 109:53918ba98306 34
Jagang 109:53918ba98306 35 virtual int isActive(){return active;}
Jagang 109:53918ba98306 36 void activate(){active=true;}
Jagang 109:53918ba98306 37 void desactivate(){active=false;}
Jagang 109:53918ba98306 38 protected:
Jagang 109:53918ba98306 39 #ifdef PLAN_A
Jagang 109:53918ba98306 40 Asserv<float>* asserv;
Jagang 109:53918ba98306 41 #else
Jagang 109:53918ba98306 42 aserv_planB* asserv;
Jagang 109:53918ba98306 43 #endif
Jagang 109:53918ba98306 44 float x,y,theta;
Jagang 109:53918ba98306 45 bool done,active;
Jagang 109:53918ba98306 46 int id;
Jagang 109:53918ba98306 47 };
Jagang 109:53918ba98306 48
Jagang 109:53918ba98306 49 #endif