Skip to content

AP_OSD: use Betaflight SYM_TOTAL_DISTANCE for DisplayPort distance icon - #33908

Merged
peterbarker merged 2 commits into
ArduPilot:masterfrom
coreyfarley:osd-displayport-dist-symbol
Aug 11, 2026
Merged

AP_OSD: use Betaflight SYM_TOTAL_DISTANCE for DisplayPort distance icon#33908
peterbarker merged 2 commits into
ArduPilot:masterfrom
coreyfarley:osd-displayport-dist-symbol

Conversation

@coreyfarley

@coreyfarley coreyfarley commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the DJI O4 OSD showing a throttle icon next to the distance-flown panel by remapping SYM_DIST from 0x04 to 0x71 in the MSP DisplayPort BTFL font table.

Also remaps SYM_LQ from 0xF8, which rendered no icon, to 0x7B (SYM_LINK_QUALITY).

Fixes #33895

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Hardware testing by @boa-pe: MicoairH743v2 + DJI O4 and O4 Pro + Goggles 3 and both icons confirmed displaying correctly (see PR comments)

Compiled successfully for SITL copter.
Glyph correctness verified against the OSD glyph reference
The reporter's parameter file (shared in the forum thread) confirms MSP_OPTIONS=4 (Betaflight fonts) and OSD_TYPE=5 (MSP DisplayPort)

Description

The OSDn_DIST (distance flown) panel prefixes its values with SYM_DIST.
On MSP DisplayPort with Betaflight fonts enabled, SYM_DIST was mapped to font index 0x04 which in the Betaflight font is SYM_THR. This resulted in the DJI goggles drawing a throttle symbol next to the distance value. This remap to 0x71 is the proper total distance glyph Betaflight uses - SYM_TOTAL_DISTANCE.

SYM_LQ (link quality) was similar, mapped to 0xF8 which has no glyph defined in the Betaflight font, so no icon rendered. 0x7B is defined as SYM_LINK_QUALITY in osd_symbols.h

The BTFL symbol table mapped SYM_DIST to 0x04, which is SYM_THR (throttle icon).
Remap to 0x71 (SYM_TOTAL_DISTANCE).

Fixes ArduPilot#33895
@boa-pe

boa-pe commented Aug 1, 2026

Copy link
Copy Markdown

Tested manually on hardware: MicoairH743v2 + DJI O4 and O4 Pro + Goggles 3. Total distance icon displayed correctly.

I would also fix missing LQ icon (betaflight uses: #define SYM_LINK_QUALITY 0x7B, betaflight define):
-static const uint8_t SYM_LQ = 0xF8;
+static const uint8_t SYM_LQ = 0x7B;
(also tested on hardware and after that change PQ icon displayer correctly on same setup as above)

and would be nice to add SYM_THR (0x04) for throttle value.

@peterbarker

Copy link
Copy Markdown
Contributor

Was the original 0x04 wrong-as-merged, or are we going to do things like break older googles/OSD setups with this change?

@boa-pe

boa-pe commented Aug 3, 2026

Copy link
Copy Markdown

Was the original 0x04 wrong-as-merged, or are we going to do things like break older googles/OSD setups with this change?

According to git blame of betaflight file total distance and link quality sybols were defined 7 years ago, and since then there were no changes.

@rmackay9

rmackay9 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

I'm tempted to merge this as-is because it is an improvement.

@coreyfarley are you planning on fixing up the other items that @boa-pe brought up either here or in another PR? No huge pressure of course

@coreyfarley

Copy link
Copy Markdown
Contributor Author

@rmackay9 I think I'll add the link quality change here and then tackle the throttle icon in another PR, if you agree?

Remap SYM_LQ from 0xF8, which rendered no icon on DJI goggles, to 0x7B,
defined as SYM_LINK_QUALITY in Betaflight's osd_symbols.h
@rmackay9

Copy link
Copy Markdown
Contributor

@boa-pe,

Do you think you could test these fixes? I'm happy to make a binary for you if necessary (just remind me of your autopilot).

@tridge

tridge commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Automated review note — AI-generated (Claude), cross-checked by an independent second model against the live diff. Please sanity-check before acting.

Reviewed at head ba2565fa28.

Verdict: APPROVE

No blockers.

  • VERIFIEDlibraries/AP_OSD/AP_OSD_MSP_DisplayPort.h:142Both glyph values match Betaflight. SYM_DIST 0x04->0x71 and SYM_LQ 0xF8->0x7B match Betaflight's long-standing definitions. Structure and binary size are unchanged; no memory, error-handling or convention concern. @boa-pe tested both on hardware (MicoairH743v2 with DJI O4/O4 Pro and Goggles 3).

  • NOTEThe compatibility question in the thread was answered. @peterbarker asked whether 0x04 was wrong-as-merged or whether this breaks older goggles. Per @boa-pe the Betaflight symbols have been unchanged for seven years, so 0x04 was simply the wrong glyph (it is Betaflight's throttle symbol). Adding SYM_THR was deliberately deferred to a separate PR, per the author and @rmackay9.

Full report: https://uav.tridgell.net/DevCallReviews/2026_08_11/devcall_pr_reviews.html

@peterbarker

Copy link
Copy Markdown
Contributor

Was the original 0x04 wrong-as-merged, or are we going to do things like break older googles/OSD setups with this change?

This didn't actually answer my question.

@rmackay9 rmackay9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge

@peterbarker
peterbarker merged commit 67cacc5 into ArduPilot:master Aug 11, 2026
99 checks passed
@Georacer Georacer moved this from Pending to 4.7.1-beta1 in 4.7 Backports Aug 11, 2026
@Georacer Georacer mentioned this pull request Aug 11, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4.7.1-beta1

Development

Successfully merging this pull request may close these issues.

OSD: DJI o4 pro throttle symbol should be on right

7 participants