fixed a bug that caused navigation not to stop

This commit is contained in:
2023-05-23 23:22:27 +02:00
parent 3a2c5b90f8
commit 1844a2a12e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ bool Navigation::getCourseCorrection(CourseCorrection& correction) {
return false; return false;
// Check if I need a new Point // Check if I need a new Point
if (distance < MIN_DISTANCE_TO_REACH_POINT && !this->preventNextPoint) { if (distance < MIN_DISTANCE_TO_REACH_POINT && this->preventNextPoint == false) {
if (!this->nextPoint()) { if (!this->nextPoint()) {
this->navigationFinished = true; this->navigationFinished = true;
this->navigationStarted = false; this->navigationStarted = false;
@@ -199,7 +199,7 @@ bool Navigation::nextPoint() {
} }
bool Navigation::setTargetPoint(Point target) { bool Navigation::setTargetPoint(Point target) {
if (target.isValid()) { if (target.isInit()) {
this->targetPoint = target; this->targetPoint = target;
return true; return true;
} }
+1 -1
View File
@@ -29,7 +29,7 @@
* *
*/ */
#define MIN_DISTANCE_BETWEEN_POINTS 0.1 #define MIN_DISTANCE_BETWEEN_POINTS 0.1
#define MIN_DISTANCE_TO_REACH_POINT 3 // TODO: Only for testing! #define MIN_DISTANCE_TO_REACH_POINT 0.5
#define AZIMUTH_UPDATE_DELAY 20 #define AZIMUTH_UPDATE_DELAY 20
/** /**