change some things, because azimuth is now
by default a signed value
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user