no time for comment
This commit is contained in:
@@ -252,7 +252,18 @@ void Navigation::updateMagneticDeclination() {
|
||||
|
||||
int16_t Navigation::calculateCourseCorrection(Point& point) {
|
||||
int16_t targetCourse = point.courseTo(this->targetPoint);
|
||||
int16_t correctionCourse = targetCourse - this->realAzimuth;
|
||||
int16_t correctionCourse;
|
||||
|
||||
if (this->calcAzimuthState == CalcAzimuthState::Good
|
||||
|| this->calcAzimuthState == CalcAzimuthState::Super)
|
||||
{
|
||||
correctionCourse = targetCourse - this->calcAzimuth;
|
||||
this->lastUsedCalcAzimuth = true;
|
||||
} else {
|
||||
correctionCourse = targetCourse - this->realAzimuth;
|
||||
this->lastUsedCalcAzimuth = false;
|
||||
}
|
||||
|
||||
if (correctionCourse > 180)
|
||||
correctionCourse -= 360;
|
||||
else if (correctionCourse < -180)
|
||||
|
||||
Reference in New Issue
Block a user