@@ -2766,7 +2766,7 @@ static bool osdDrawSingleElement(uint8_t item)
27662766#endif
27672767 ) && isImuHeadingValid ()) {
27682768
2769- if (osdConfig ()-> hud_homepoint || osdConfig ()-> hud_radar_disp > 0 || osdConfig ()-> hud_wp_disp > 0 ) {
2769+ if (osdConfig ()-> hud_homepoint || osdConfig ()-> hud_radar_disp > 0 || osdConfig ()-> hud_wp_disp > 0 || osdConfig () -> hud_flight_direction ) {
27702770 osdHudClear ();
27712771 }
27722772
@@ -2776,6 +2776,23 @@ static bool osdDrawSingleElement(uint8_t item)
27762776 osdHudDrawPoi (GPS_distanceToHome , GPS_directionToHome , - osdGetAltitude () / 100 , 0 , SYM_HOME , 0 , 0 );
27772777 }
27782778
2779+ // -------- POI : Flight direction
2780+
2781+ if (osdConfig ()-> hud_flight_direction ) {
2782+ int vx = getEstimatedActualVelocity (X ); // in cm/s
2783+ int vy = getEstimatedActualVelocity (Y ); // in cm/s
2784+ int vz = getEstimatedActualVelocity (Z ); // in cm/s
2785+
2786+ // Nur Richtung anzeigen, keine Vorausschau mehr
2787+ float direction_deg = RADIANS_TO_DEGREES (atan2f ((float )vy , (float )vx ));
2788+ int altitude_relative = (vz / 100 );
2789+
2790+ // Flugrichtung nur darstellen, wenn relevante Bewegung vorhanden ist
2791+ //osdHudDrawPoi(0, (int16_t)direction_deg, altitude_relative, 0, SYM_ALERT, 0, 0);
2792+ osdHudDrawDirection ((int16_t )direction_deg , altitude_relative , SYM_ALERT );
2793+
2794+ }
2795+
27792796 // -------- POI : Nearby aircrafts from ESP32 radar
27802797
27812798 if (osdConfig ()-> hud_radar_disp > 0 ) { // Display the POI from the radar
@@ -4155,6 +4172,7 @@ PG_RESET_TEMPLATE(osdConfig_t, osdConfig,
41554172 .hud_margin_v = SETTING_OSD_HUD_MARGIN_V_DEFAULT ,
41564173 .hud_homing = SETTING_OSD_HUD_HOMING_DEFAULT ,
41574174 .hud_homepoint = SETTING_OSD_HUD_HOMEPOINT_DEFAULT ,
4175+ .hud_flight_direction = SETTING_OSD_HUD_FLIGHT_DIRECTION_DEFAULT ,
41584176 .hud_radar_disp = SETTING_OSD_HUD_RADAR_DISP_DEFAULT ,
41594177 .hud_radar_range_min = SETTING_OSD_HUD_RADAR_RANGE_MIN_DEFAULT ,
41604178 .hud_radar_range_max = SETTING_OSD_HUD_RADAR_RANGE_MAX_DEFAULT ,
0 commit comments