diff --git a/include/Version.h b/include/Version.h index d57b88b..9ce3961 100644 --- a/include/Version.h +++ b/include/Version.h @@ -1,9 +1,9 @@ // AUTO GENERATED FILE, DO NOT EDIT #ifndef VERSION - #define VERSION "0.1.5" + #define VERSION "0.1.7" #endif #ifndef BUILD_TIMESTAMP - #define BUILD_TIMESTAMP "2023-08-07 20:54:44.940398" + #define BUILD_TIMESTAMP "2023-08-07 21:22:27.260906" #endif \ No newline at end of file diff --git a/lib/Navigation/navigation.cpp b/lib/Navigation/navigation.cpp index 23a2bc9..70e6e6c 100644 --- a/lib/Navigation/navigation.cpp +++ b/lib/Navigation/navigation.cpp @@ -192,9 +192,7 @@ void Navigation::updateCurrentLocation() { int16_t Navigation::calculateCourseCorrection(Point& point) { int16_t targetCourse = point.courseTo(this->targetPoint); - // correction = targetCourse - currentCourse - int16_t signedAzimuth = this->azimuth > 180 ? this->azimuth - 360 : this->azimuth; - int16_t correctionCourse = targetCourse - signedAzimuth; + int16_t correctionCourse = targetCourse - this->azimuth; if (correctionCourse > 180) correctionCourse -= 360; else if (correctionCourse < -180) diff --git a/lib/Navigation/navigation.h b/lib/Navigation/navigation.h index f9665b3..5388a66 100644 --- a/lib/Navigation/navigation.h +++ b/lib/Navigation/navigation.h @@ -182,7 +182,7 @@ class Navigation { * * @return uint16_t degree */ - uint16_t getAzimuth() const { return this->azimuth; } + int16_t getAzimuth() const { return this->azimuth; } QMC5883LCompass* getCompass() const { return this->compass; } Point::Accuracy getMinAccuracy() const { return this->minAccuracy; } @@ -244,9 +244,10 @@ class Navigation { char* user; char* password; + int16_t azimuth = INT16_MAX; + uint8_t timeToWait = 200; uint16_t port; - uint16_t azimuth = UINT16_MAX; uint32_t lastMillis = 0; uint32_t ubxUpdateTime = 0; diff --git a/version b/version index def9a01..a1e1395 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.1.5 \ No newline at end of file +0.1.7 \ No newline at end of file