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