Code to run the microcontrollers on the R5 competition bot

Dependencies:   LineSensors mbed

Committer:
Hypna
Date:
Sat Apr 18 04:57:20 2015 +0000
Revision:
22:8f726dc175cd
Parent:
21:44d9b42c04a9
stuff

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jmar11 17:5046b27f5441 1 #ifndef NAVCONTROLLER_H
jmar11 17:5046b27f5441 2 #define NAVCONTROLLER_H
jmar11 17:5046b27f5441 3
jmar11 17:5046b27f5441 4 #include "r5map.h"
jmar11 17:5046b27f5441 5 #include <stack>
jmar11 17:5046b27f5441 6 #include <vector>
jmar11 17:5046b27f5441 7
Hypna 19:9f4510646c9e 8 namespace NavController
Hypna 19:9f4510646c9e 9 {
jmar11 17:5046b27f5441 10
jmar11 17:5046b27f5441 11 class NavController
jmar11 17:5046b27f5441 12 {
jmar11 17:5046b27f5441 13 public:
jmar11 17:5046b27f5441 14 NavController(int mapSize = 5);
Hypna 19:9f4510646c9e 15 R5Map::direction nextExploreMove();
Hypna 19:9f4510646c9e 16 R5Map::direction nextTraceMove();
Hypna 22:8f726dc175cd 17 bool isDone();
jmar11 17:5046b27f5441 18
jmar11 17:5046b27f5441 19 private:
Hypna 19:9f4510646c9e 20 R5Map::position end;
Hypna 19:9f4510646c9e 21 R5Map::direction nextExploreMove(); //calculates the next move in maze exploration
Hypna 20:0e6b7dce21c0 22 R5Map::direction nextTraceMove();
Hypna 19:9f4510646c9e 23 void updateMap(); //records all the sensor information into the map object
Hypna 19:9f4510646c9e 24 bool readSensor(R5Map::direction wall); //returns true if there is a wall in direction "wall"
Hypna 19:9f4510646c9e 25 void prepReturn();
jmar11 17:5046b27f5441 26
Hypna 19:9f4510646c9e 27 R5Map::R5Map map;
Hypna 19:9f4510646c9e 28 stack<R5Map::direction> path; //a record of the bots path
jmar11 17:5046b27f5441 29 };
Hypna 19:9f4510646c9e 30 } //end namespace
jmar11 17:5046b27f5441 31 #endif