Eurobot2012_Primary

Dependencies:   mbed Eurobot_2012_Primary

Committer:
narshu
Date:
Sat Apr 28 17:21:24 2012 +0000
Revision:
9:377560539b74
Parent:
ai/ai.h@4:7b7334441da9
Child:
13:57ea4e520dbd
Restructured project to have a single shared lib; Also raised the RF baud rate

Who changed what in which revision?

UserRevisionLine numberNew contents of line
narshu 4:7b7334441da9 1 #ifndef AI_H
narshu 4:7b7334441da9 2 #define AI_H
narshu 4:7b7334441da9 3
narshu 4:7b7334441da9 4 #include "rtos.h"
narshu 4:7b7334441da9 5
narshu 4:7b7334441da9 6 class AI {
narshu 4:7b7334441da9 7 public:
narshu 4:7b7334441da9 8 AI();
narshu 4:7b7334441da9 9
narshu 4:7b7334441da9 10 Mutex targetlock;
narshu 4:7b7334441da9 11 Thread thr_AI;
narshu 4:7b7334441da9 12
narshu 4:7b7334441da9 13 struct Target {
narshu 4:7b7334441da9 14 float x;
narshu 4:7b7334441da9 15 float y;
narshu 4:7b7334441da9 16 float theta;
narshu 4:7b7334441da9 17 bool facing;
narshu 4:7b7334441da9 18 } target;
narshu 4:7b7334441da9 19
narshu 4:7b7334441da9 20 void settarget(float targetX, float targetY, float targetTheta, bool targetfacing = true);
narshu 4:7b7334441da9 21 void settarget(Target);
narshu 4:7b7334441da9 22 Target gettarget();
narshu 4:7b7334441da9 23
narshu 4:7b7334441da9 24 bool flag_terminate;// = false;
narshu 4:7b7334441da9 25
narshu 4:7b7334441da9 26 private:
narshu 4:7b7334441da9 27
narshu 4:7b7334441da9 28 void ai_thread ();
narshu 4:7b7334441da9 29 static void aithreadwrapper(void const *arg){ ((AI*)arg)->ai_thread(); }
narshu 4:7b7334441da9 30
narshu 4:7b7334441da9 31 };
narshu 4:7b7334441da9 32
narshu 4:7b7334441da9 33 #endif //AI_H