2017-06-06 14:20:12 -05:00
|
|
|
/*
|
|
|
|
* PURPOSE: (VehicleController class)
|
|
|
|
*/
|
2016-02-18 16:14:44 -06:00
|
|
|
#ifndef VEHICLE_CONTROLLER_HH
|
|
|
|
#define VEHICLE_CONTROLLER_HH
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include "Guidance/include/point.hh"
|
|
|
|
#include "Guidance/include/navigator.hh"
|
|
|
|
#include "Control/include/differentialDriveController.hh"
|
|
|
|
|
|
|
|
#ifndef PI
|
|
|
|
#define PI 3.141592653589793
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class VehicleController {
|
|
|
|
public:
|
|
|
|
VehicleController(std::vector<Point>* waypointQueue,
|
|
|
|
Navigator& navigator,
|
|
|
|
DifferentialDriveController& driveController,
|
|
|
|
double arrival_distance);
|
|
|
|
|
|
|
|
int getCurrentDestination(Point& currentDestination);
|
|
|
|
void setWayPointQueue( std::vector<Point>* waypointQueue );
|
|
|
|
void printDestination();
|
|
|
|
void update();
|
|
|
|
|
2020-08-03 10:09:34 -05:00
|
|
|
// Homing Functions
|
|
|
|
// Commands wheelbot to navigate to home
|
|
|
|
void gohome();
|
2020-08-03 10:44:52 -05:00
|
|
|
// Returns the value of the variable endofWaypoints
|
2020-08-03 10:09:34 -05:00
|
|
|
bool getStatus();
|
|
|
|
|
2016-02-18 16:14:44 -06:00
|
|
|
private:
|
|
|
|
// Do not allow the default constructor to be used.
|
|
|
|
VehicleController();
|
|
|
|
|
|
|
|
std::vector<Point>* waypointQueue;
|
|
|
|
std::vector<Point>::iterator destination;
|
|
|
|
Point departure;
|
|
|
|
Navigator& navigator;
|
|
|
|
DifferentialDriveController& driveController;
|
|
|
|
|
2020-08-03 10:09:34 -05:00
|
|
|
// Homing variables
|
|
|
|
// Records if end of simulation
|
2020-08-03 10:44:52 -05:00
|
|
|
bool endofWaypoints;
|
2020-08-03 10:09:34 -05:00
|
|
|
// Records if told to go home
|
|
|
|
bool homeCommanded;
|
|
|
|
|
2016-02-18 16:14:44 -06:00
|
|
|
double arrivalDistance;
|
|
|
|
};
|
|
|
|
#endif
|