mirror of
https://github.com/nasa/trick.git
synced 2025-02-21 01:31:25 +00:00
Variable Name Update
This commit is contained in:
parent
047d31cba3
commit
5638a62a22
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user