Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some OSD elements are not drawn when GPS is disabled. #9225

Closed
mmosca opened this issue Aug 7, 2023 · 0 comments · Fixed by #9229
Closed

Some OSD elements are not drawn when GPS is disabled. #9225

mmosca opened this issue Aug 7, 2023 · 0 comments · Fixed by #9229

Comments

@mmosca
Copy link
Collaborator

mmosca commented Aug 7, 2023

Current Behavior

If GPS feature is disabled, osdIncElementIndex will short cut to OSD_ITEM_COUNT when displaying OSD_GLIDE_RANGE or OSD_NAV_WP_MULTI_MISSION_INDEX, skipping any other OSD element after those.

Affected items are:
OSD_GROUND_COURSE,
OSD_CROSS_TRACK_ERROR,
OSD_PILOT_NAME,
OSD_PAN_SERVO_CENTRED,

and any new element added in the future.

Steps to Reproduce

Add OSD_PILOT_NAME to OSD
Disable GPS feature
OSD_PILOT_NAME is not displayed in OSD.

Expected behavior

OSD_PILOT_NAME is displayed, even with GPS feature disabled.

Suggested solution(s)

Change OSD_ITEM_COUNT to OSD_PILOT_NAME in osdIncElementIndex

        if (elementIndex == OSD_GLIDE_RANGE) {
            elementIndex = feature(FEATURE_CURRENT_METER) ? OSD_CLIMB_EFFICIENCY : OSD_PILOT_NAME;
        }
        if (elementIndex == OSD_NAV_WP_MULTI_MISSION_INDEX) {
            elementIndex = OSD_PILOT_NAME;
        }

This assumes shortcutting OSD_GROUND_COURSE, OSD_CROSS_TRACK_ERROR is the desired behavior, as these elements depend on GPS.

@mmosca mmosca changed the title Some OSD elements are not drawn, if GPS is disabled. Some OSD elements are not drawn when GPS is disabled. Aug 7, 2023
mmosca added a commit that referenced this issue Aug 7, 2023
When adding new elements, we probably forgot to update the logic that
increments the element index in the osd rendering code.
mmosca added a commit that referenced this issue Aug 7, 2023
Skipping to OSD_ITEM_COUNT at that point ignores new OSD elements
mmosca added a commit that referenced this issue Aug 8, 2023
Fix for #9225, some OSD elements are skipped incorrectly, when GPS is not present.
sensei-hacker pushed a commit to sensei-hacker/inav_unofficial_targets that referenced this issue Oct 4, 2023
Skipping to OSD_ITEM_COUNT at that point ignores new OSD elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant