Skip to content

Commit 4aef327

Browse files
committed
init
vertical position is on the wrong side for home point and also for direction on my wing.
1 parent 2795eb2 commit 4aef327

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

docs/Settings.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4832,6 +4832,16 @@ To vertically adjust the whole OSD and AHI and scrolling bars
48324832

48334833
---
48344834

4835+
### osd_hud_flightpoint
4836+
4837+
To 3D-display the moving destination direction in the hud
4838+
4839+
| Default | Min | Max |
4840+
| --- | --- | --- |
4841+
| OFF | OFF | ON |
4842+
4843+
---
4844+
48354845
### osd_hud_homepoint
48364846

48374847
To 3D-display the home point location in the hud

src/main/cms/cms_menu_osd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ static const OSD_Entry menuOsdHud2Entries[] = {
420420

421421
OSD_SETTING_ENTRY("HOMING ARROWS", SETTING_OSD_HUD_HOMING),
422422
OSD_SETTING_ENTRY("HOME POINT", SETTING_OSD_HUD_HOMEPOINT),
423+
OSD_SETTING_ENTRY("FLIGHT POINT", SETTING_OSD_HUD_FLIGHTPOINT),
423424
OSD_SETTING_ENTRY("RADAR MAX AIRCRAFT", SETTING_OSD_HUD_RADAR_DISP),
424425
OSD_SETTING_ENTRY("RADAR MIN RANGE", SETTING_OSD_HUD_RADAR_RANGE_MIN),
425426
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_flightpoint
3516+
description: "To 3D-display the moving destination direction in the hud"
3517+
default_value: OFF
3518+
field: hud_flightpoint
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: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2754,7 +2754,7 @@ static bool osdDrawSingleElement(uint8_t item)
27542754
#endif
27552755
) && isImuHeadingValid()) {
27562756

2757-
if (osdConfig()->hud_homepoint || osdConfig()->hud_radar_disp > 0 || osdConfig()->hud_wp_disp > 0) {
2757+
if (osdConfig()->hud_homepoint || osdConfig()->hud_radar_disp > 0 || osdConfig()->hud_wp_disp > 0 || osdConfig()->hud_flightpoint) {
27582758
osdHudClear();
27592759
}
27602760

@@ -2764,6 +2764,29 @@ static bool osdDrawSingleElement(uint8_t item)
27642764
osdHudDrawPoi(GPS_distanceToHome, GPS_directionToHome, -osdGetAltitude() / 100, 0, SYM_HOME, 0 , 0);
27652765
}
27662766

2767+
// -------- POI : Flight direction
2768+
2769+
if (osdConfig()->hud_flightpoint) {
2770+
int vx = getEstimatedActualVelocity(X); // in cm/s
2771+
int vy = getEstimatedActualVelocity(Y); // in cm/s
2772+
int vz = getEstimatedActualVelocity(Z); // in cm/s
2773+
2774+
// Nur Richtung anzeigen, keine Vorausschau mehr
2775+
float direction_deg = RADIANS_TO_DEGREES(atan2f((float)vy, (float)vx));
2776+
int altitude_relative = -(vz / 100); // als Höhe anzeigen (optional)
2777+
2778+
// Flugrichtung nur darstellen, wenn relevante Bewegung vorhanden ist
2779+
osdHudDrawPoi(
2780+
0, // Entfernung nicht nötig
2781+
(int16_t)direction_deg, // Richtung aus Geschwindigkeit
2782+
altitude_relative, // Vertikale Bewegung
2783+
0,
2784+
SYM_ALERT,
2785+
0,
2786+
0
2787+
);
2788+
}
2789+
27672790
// -------- POI : Nearby aircrafts from ESP32 radar
27682791

27692792
if (osdConfig()->hud_radar_disp > 0) { // Display the POI from the radar
@@ -4143,6 +4166,7 @@ PG_RESET_TEMPLATE(osdConfig_t, osdConfig,
41434166
.hud_margin_v = SETTING_OSD_HUD_MARGIN_V_DEFAULT,
41444167
.hud_homing = SETTING_OSD_HUD_HOMING_DEFAULT,
41454168
.hud_homepoint = SETTING_OSD_HUD_HOMEPOINT_DEFAULT,
4169+
.hud_flightpoint = SETTING_OSD_HUD_FLIGHTPOINT_DEFAULT,
41464170
.hud_radar_disp = SETTING_OSD_HUD_RADAR_DISP_DEFAULT,
41474171
.hud_radar_range_min = SETTING_OSD_HUD_RADAR_RANGE_MIN_DEFAULT,
41484172
.hud_radar_range_max = SETTING_OSD_HUD_RADAR_RANGE_MAX_DEFAULT,

src/main/io/osd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ typedef struct osdConfig_s {
429429
uint8_t hud_margin_v;
430430
bool hud_homing;
431431
bool hud_homepoint;
432+
bool hud_flightpoint;
432433
uint8_t hud_radar_disp;
433434
uint16_t hud_radar_range_min;
434435
uint16_t hud_radar_range_max;

0 commit comments

Comments
 (0)