mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 17:55:28 +03:00
Merge pull request #8723 from breadoven/abo_osd_home_direction_fix
Fixed wing OSD home heading arrow and error fix
This commit is contained in:
commit
ab50513ef8
1 changed files with 5 additions and 4 deletions
|
@ -1769,7 +1769,8 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
if (!(osdConfig()->pan_servo_pwm2centideg == 0)){
|
||||
panHomeDirOffset = osdPanServoHomeDirectionOffset();
|
||||
}
|
||||
int homeDirection = GPS_directionToHome - DECIDEGREES_TO_DEGREES(osdGetHeading()) + panHomeDirOffset;
|
||||
int16_t flightDirection = STATE(AIRPLANE) ? CENTIDEGREES_TO_DEGREES(posControl.actualState.cog) : DECIDEGREES_TO_DEGREES(osdGetHeading());
|
||||
int homeDirection = GPS_directionToHome - flightDirection + panHomeDirOffset;
|
||||
osdDrawDirArrow(osdDisplayPort, osdGetDisplayPortCanvas(), OSD_DRAW_POINT_GRID(elemPosX, elemPosY), homeDirection);
|
||||
}
|
||||
} else {
|
||||
|
@ -1789,7 +1790,7 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
buff[1] = SYM_HEADING;
|
||||
|
||||
if (isImuHeadingValid() && navigationPositionEstimateIsHealthy()) {
|
||||
int16_t h = lrintf(CENTIDEGREES_TO_DEGREES((float)wrap_18000(DEGREES_TO_CENTIDEGREES((int32_t)GPS_directionToHome) - DECIDEGREES_TO_CENTIDEGREES((int32_t)osdGetHeading()))));
|
||||
int16_t h = lrintf(CENTIDEGREES_TO_DEGREES((float)wrap_18000(DEGREES_TO_CENTIDEGREES((int32_t)GPS_directionToHome) - (STATE(AIRPLANE) ? posControl.actualState.cog : DECIDEGREES_TO_CENTIDEGREES((int32_t)osdGetHeading())))));
|
||||
tfp_sprintf(buff + 2, "%4d", h);
|
||||
} else {
|
||||
strcpy(buff + 2, "----");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue