Code to run the microcontrollers on the R5 competition bot

Dependencies:   LineSensors mbed

navcontroller.h

Committer:
Hypna
Date:
2015-04-18
Revision:
22:8f726dc175cd
Parent:
21:44d9b42c04a9

File content as of revision 22:8f726dc175cd:

#ifndef NAVCONTROLLER_H
#define NAVCONTROLLER_H

#include "r5map.h"
#include <stack>
#include <vector>

namespace NavController
{

class NavController
{
    public:
    NavController(int mapSize = 5);
    R5Map::direction nextExploreMove();
    R5Map::direction nextTraceMove();
    bool isDone();

    private:
    R5Map::position end;
    R5Map::direction nextExploreMove();         //calculates the next move in maze exploration
    R5Map::direction nextTraceMove();
    void updateMap();                           //records all the sensor information into the map object
    bool readSensor(R5Map::direction wall);     //returns true if there is a wall in direction "wall"
    void prepReturn();

    R5Map::R5Map map;
    stack<R5Map::direction> path;               //a record of the bots path
};
} //end namespace
#endif