1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

Update navigation.c

This commit is contained in:
breadoven 2022-05-03 11:12:21 +01:00
parent 7c9365a797
commit 088edec2c1

View file

@ -2146,6 +2146,7 @@ static int16_t getCourseOverGround(void) // returns degrees
* Otherwise use gyro YAW for multirotor, apply rcCommand based YAW correction */
if (isGPSHeadingValid()) {
return DECIDEGREES_TO_DEGREES(gpsSol.groundCourse);
} else if (STATE(MULTIROTOR) && sensors(SENSOR_MAG) && posControl.flags.estHeadingStatus == EST_TRUSTED) {
return CENTIDEGREES_TO_DEGREES(wrap_36000(posControl.actualState.yaw + RADIANS_TO_CENTIDEGREES(atan2_approx(rcCommand[ROLL], rcCommand[PITCH]))));
}