Variable Name Update

This commit is contained in:
avinashc99 2020-08-03 10:44:52 -05:00
parent 047d31cba3
commit 5638a62a22
2 changed files with 8 additions and 8 deletions

View File

@ -28,7 +28,7 @@ class VehicleController {
// Homing Functions
// Commands wheelbot to navigate to home
void gohome();
// Returns the value of the variable endofSimulation
// Returns the value of the variable endofWaypoints
bool getStatus();
private:
@ -43,7 +43,7 @@ class VehicleController {
// Homing variables
// Records if end of simulation
bool endofSimulation;
bool endofWaypoints;
// Records if told to go home
bool homeCommanded;

View File

@ -19,7 +19,7 @@ VehicleController::VehicleController( std::vector<Point>* wayPoints,
printDestination();
// Initialize homing variables
endofSimulation = false;
endofWaypoints = false;
homeCommanded = false;
}
@ -51,25 +51,25 @@ void VehicleController::printDestination() {
}
}
// Returns the value of the variable endofSimulation
// Returns the value of the variable endofWaypoints
bool VehicleController::getStatus() {
return endofSimulation;
return endofWaypoints;
}
void VehicleController::update() {
if (destination == waypointQueue->end() && endofSimulation == false) {
if (destination == waypointQueue->end() && endofWaypoints == false) {
if (homeCommanded == false) {
driveController.update(0.0, 0.0);
}
endofSimulation = true;
endofWaypoints = true;
} else {
double distance_err = navigator.distanceTo(*destination);
if ( distance_err > arrivalDistance) {
double heading_err = navigator.bearingTo(*destination);
driveController.update(distance_err, heading_err);
} else {
if (endofSimulation != true) {
if (endofWaypoints != true) {
std::cout << "Arrived at Destination." << std::endl;
destination ++;
printDestination();