From a5cf2f2c1d77358f1795d915f16dd682e5fc7cdc Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Sun, 18 Dec 2022 10:33:04 +0100 Subject: [PATCH] spelling --- lib/Navigation/navigation.cpp | 6 +++--- src/driveModi/Modi/Autopilot/autopilot.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Navigation/navigation.cpp b/lib/Navigation/navigation.cpp index 5981cde..0b9e0ac 100644 --- a/lib/Navigation/navigation.cpp +++ b/lib/Navigation/navigation.cpp @@ -144,7 +144,7 @@ bool Navigation::addCurrentPosToRoute() { return true; } - // Ever Point after the first + // Every Point after the first if (MIN_DISTANCE_BETWEEN_POINTS <= this->currentPosition.distanceTo(this->lastPoint)) { this->route->addPointToRoute(this->currentPosition); this->lastPoint = this->currentPosition; @@ -170,10 +170,10 @@ void Navigation::updateCurrentLocation() { } bool Navigation::nextPoint() { + if (!this->navigationStarted) return false; - Point newTargetPoint = this->route->getNextPoint(); - return this->setTargetPoint(newTargetPoint); + return this->setTargetPoint(this->route->getNextPoint()); } bool Navigation::setTargetPoint(Point target) { diff --git a/src/driveModi/Modi/Autopilot/autopilot.cpp b/src/driveModi/Modi/Autopilot/autopilot.cpp index d66467c..2bbc421 100644 --- a/src/driveModi/Modi/Autopilot/autopilot.cpp +++ b/src/driveModi/Modi/Autopilot/autopilot.cpp @@ -15,7 +15,7 @@ Autopilot::Autopilot(MoveControl* moveControl, Navigation* navigation) : ManualControl(moveControl) { this->navigation = navigation; this->navigationStarted = this->navigation->startNavigation(); - this->navigation->getRouteInfo(); + this->routeInfo = this->navigation->getRouteInfo(); this->courseCorrection.correction = 0; this->courseCorrection.distance = 0; this->updateDisplay = true;