Skip to content

Commit a81d27a

Browse files
committed
Implementation
1 parent 78f5741 commit a81d27a

File tree

7 files changed

+8
-22
lines changed

7 files changed

+8
-22
lines changed

docs/OSD.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ Here are the OSD Elements provided by INAV.
197197
| 163 | OSD_COURSE_TO_FENCE | 8.0.0 | |
198198
| 164 | OSD_H_DIST_TO_FENCE | 8.0.0 | |
199199
| 165 | OSD_V_DIST_TO_FENCE | 8.0.0 | |
200-
| 166 | OSD_FLIGHT_DIR | 9.0.0 | |
201200

202201
# Pilot Logos
203202

src/main/cms/cms_menu_osd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ static const OSD_Entry menuOsdElemsEntries[] =
204204
OSD_ELEMENT_ENTRY("BATT % REM", OSD_BATTERY_REMAINING_PERCENT),
205205
#ifdef USE_GPS
206206
OSD_ELEMENT_ENTRY("HOME DIR", OSD_HOME_DIR),
207-
OSD_ELEMENT_ENTRY("FLIGHT_DIR", OSD_FLIGHT_DIR),
208207
OSD_ELEMENT_ENTRY("HOME HEAD. ERR", OSD_HOME_HEADING_ERROR),
209208
OSD_ELEMENT_ENTRY("HOME DIST", OSD_HOME_DIST),
210209
OSD_ELEMENT_ENTRY("TRIP DIST", OSD_TRIP_DIST),
@@ -421,6 +420,7 @@ static const OSD_Entry menuOsdHud2Entries[] = {
421420

422421
OSD_SETTING_ENTRY("HOMING ARROWS", SETTING_OSD_HUD_HOMING),
423422
OSD_SETTING_ENTRY("HOME POINT", SETTING_OSD_HUD_HOMEPOINT),
423+
OSD_SETTING_ENTRY("FLIGHT DIRECTION", SETTING_OSD_HUD_FLIGHT_DIRECTION),
424424
OSD_SETTING_ENTRY("RADAR MAX AIRCRAFT", SETTING_OSD_HUD_RADAR_DISP),
425425
OSD_SETTING_ENTRY("RADAR MIN RANGE", SETTING_OSD_HUD_RADAR_RANGE_MIN),
426426
OSD_SETTING_ENTRY("RADAR MAX RANGE", SETTING_OSD_HUD_RADAR_RANGE_MAX),

src/main/fc/settings.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3512,6 +3512,11 @@ groups:
35123512
default_value: OFF
35133513
field: hud_homepoint
35143514
type: bool
3515+
- name: osd_hud_flight_direction
3516+
description: "To 3D-display the moving destination direction in the hud"
3517+
default_value: OFF
3518+
field: hud_flight_direction
3519+
type: bool
35153520
- name: osd_hud_radar_disp
35163521
description: "Maximum count of nearby aircrafts or points of interest to display in the hud, as sent from an ESP32 LoRa module. Set to 0 to disable (show nothing). The nearby aircrafts will appear as markers A, B, C, etc"
35173522
default_value: 0

src/main/io/osd.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,18 +1957,6 @@ static bool osdDrawSingleElement(uint8_t item)
19571957
}
19581958
return true;
19591959
}
1960-
1961-
case OSD_FLIGHT_DIR:
1962-
{
1963-
int16_t vx = getEstimatedActualVelocity(X); // in cm/s
1964-
int16_t vy = getEstimatedActualVelocity(Y); // in cm/s
1965-
int16_t vz = getEstimatedActualVelocity(Z); // in cm/s
1966-
float direction_deg = RADIANS_TO_DEGREES(atan2f((float)vy, (float)vx));
1967-
int16_t altitude_relative = (vz / 100); // in m
1968-
//osdHudDrawPoi(0, (int16_t)direction_deg, altitude_relative, 0, SYM_ALERT, 0, 0);
1969-
osdHudDrawDirection((int16_t)direction_deg, altitude_relative, SYM_ALERT);
1970-
return true;
1971-
}
19721960

19731961
case OSD_HOME_HEADING_ERROR:
19741962
{
@@ -2782,12 +2770,10 @@ static bool osdDrawSingleElement(uint8_t item)
27822770
int vx = getEstimatedActualVelocity(X); // in cm/s
27832771
int vy = getEstimatedActualVelocity(Y); // in cm/s
27842772
int vz = getEstimatedActualVelocity(Z); // in cm/s
2785-
2786-
// Nur Richtung anzeigen, keine Vorausschau mehr
2773+
27872774
float direction_deg = RADIANS_TO_DEGREES(atan2f((float)vy, (float)vx));
27882775
int altitude_relative = (vz / 100);
2789-
2790-
// Flugrichtung nur darstellen, wenn relevante Bewegung vorhanden ist
2776+
27912777
//osdHudDrawPoi(0, (int16_t)direction_deg, altitude_relative, 0, SYM_ALERT, 0, 0);
27922778
osdHudDrawDirection((int16_t)direction_deg, altitude_relative, SYM_ALERT);
27932779

@@ -4281,7 +4267,6 @@ void pgResetFn_osdLayoutsConfig(osdLayoutsConfig_t *osdLayoutsConfig)
42814267
// OSD_VARIO_NUM at the right of OSD_VARIO
42824268
osdLayoutsConfig->item_pos[0][OSD_VARIO_NUM] = OSD_POS(24, 7);
42834269
osdLayoutsConfig->item_pos[0][OSD_HOME_DIR] = OSD_POS(14, 11);
4284-
osdLayoutsConfig->item_pos[0][OSD_FLIGHT_DIR] = OSD_POS(14, 12);
42854270
osdLayoutsConfig->item_pos[0][OSD_ARTIFICIAL_HORIZON] = OSD_POS(8, 6);
42864271
osdLayoutsConfig->item_pos[0][OSD_HORIZON_SIDEBARS] = OSD_POS(8, 6);
42874272

src/main/io/osd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ typedef enum {
169169
OSD_GPS_LON,
170170
OSD_GPS_LAT,
171171
OSD_HOME_DIR,
172-
OSD_FLIGHT_DIR,
173172
OSD_HOME_DIST,
174173
OSD_HEADING,
175174
OSD_VARIO,

src/main/io/osd_dji_hd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ const djiOsdMapping_t djiOSDItemIndexMap[] = {
190190
{ -1, 0 }, // DJI: OSD_MAIN_BATT_USAGE
191191
{ -1, 0 }, // DJI: OSD_DISARMED
192192
{ OSD_HOME_DIR, FEATURE_GPS }, // DJI: OSD_HOME_DIR
193-
{ OSD_FLIGHT_DIR, FEATURE_GPS }, // DJI: OSD_FLIGHT_DIR
194193
{ OSD_HOME_DIST, FEATURE_GPS }, // DJI: OSD_HOME_DIST
195194
{ OSD_HEADING, 0 }, // DJI: OSD_NUMERICAL_HEADING
196195
{ OSD_VARIO_NUM, 0 }, // DJI: OSD_NUMERICAL_VARIO

src/main/io/osd_hud.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ typedef struct displayCanvas_s displayCanvas_t;
2626
void osdHudClear(void);
2727
void osdHudDrawCrosshair(displayCanvas_t *canvas, uint8_t px, uint8_t py);
2828
void osdHudDrawHoming(uint8_t px, uint8_t py);
29-
void osdHudDrawDirection(int16_t poiDirection, int32_t poiAltitude, uint16_t poiSymbol);
3029
void osdHudDrawPoi(uint32_t poiDistance, int16_t poiDirection, int32_t poiAltitude, uint8_t poiType, uint16_t poiSymbol, int16_t poiP1, int16_t poiP2);
3130
void osdHudDrawDirection(int16_t poiDirection, int32_t poiAltitude, uint16_t poiSymbol);
3231
int8_t radarGetNearestPOI(void);

0 commit comments

Comments
 (0)