Code to run the microcontrollers on the R5 competition bot

Dependencies:   LineSensors mbed

navcontroller.h

Committer:
Hypna
Date:
2015-04-18
Revision:
20:0e6b7dce21c0
Parent:
19:9f4510646c9e
Child:
21:44d9b42c04a9

File content as of revision 20:0e6b7dce21c0:

#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();

    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