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

Add pilot logo to OSD #9332

Merged
merged 20 commits into from
Oct 12, 2023
Merged

Add pilot logo to OSD #9332

merged 20 commits into from
Oct 12, 2023

Conversation

MrD-RC
Copy link
Collaborator

@MrD-RC MrD-RC commented Oct 1, 2023

This change adds the ability to have a pilot logo on the boot and arm screen and a smaller version that can be displayed anywhere on the OSD. This change also adds a different arming screen for HD systems, to include the logo.

The large pilot logo is HD only. The small logo also works on analogue. The large pilot logo would work on analogue. Only the MAX7456 chip seems to corrupt the last 33 characters seem to get corrupted on power loss. If anyone has any ideas on how this could be fixed. I'm open to suggestions.

While making this change I also cleaned up the arming screen a little. If there is space, stats are also shown on the arming screen now, if enabled.

Requires Configurator: iNavFlight/inav-configurator#1835

New settings:

osd_arm_screen_display_time The amount of time the arming screen is displayed.
osd_inav_to_pilot_logo_spacing The spacing between two logos. This can be used to have no space, so the original INAV logo and Pilot Logo can be combined in to a larger logo.
osd_use_pilot_logo Enable to use the large pilot logo.

Examples

Combined pilot logo on HD arming screen
image

HD Arming screen with pilot logo enabled
image

Example of issue with analogue font
Logo shown after installing the font, but before power loss (removing USB or battery)
image

Logo shown after power loss
image

MrD-RC added 17 commits August 22, 2023 17:31
- Separated HD and SD arming screen
- Added symbol for pilot logo
- Switched space indents to tabs in osd_symbols.h
- Switch small pilot logo to 3 characters
- Added base code for arm screen
- Added use pilot logo option to CLI
- Converted osd.h to use tabs
- Added small pilot logo initial code
- Fixed error from tabs in osd.h
- Added arm screen timeout as CLI settable option. Defaults to current 1.5 seconds.
- Fixed boot screen stats. Bug would have existed since 3.0
- Initial code for swapping logos on the boot screen
- Replaced pseudo code with actual logic for using pilot logo on HD arming screen
- Used already existing logic for detecting if display is HD
Unfortunately the large pilot logo can't be available on SD. There seems to be an issue with the storage on the MAX7456 chip. The last 33 characters of page 2 seem to corrupt on power loss. After uploading the font, all looks fine. After a reboot, the logo looks fine. But after a power cycle, the last 33 characters are corrupted.

Changes:
- cms.h now back to tabs
- moved logo and stats drawing to own functions, to save repetition.
- Made large pilot logo HD only
- Disabled large pilot logo support with BFCOMPAT mode.
- Stats and logos will self centre, no matter the column width.
- All arm screen times will be increased by 3 seconds with a safehome failure message.
- Added the ability to specify the gap between the logos
- Matched arm screen and boot screen logo displays
Changes to HD arming screen
- Explicitly select safehome row
- temporarily removed stats due to space
- combined craft name and armed to a single row.
- put lon and lat on single row.
- changed time format (need to test), as tenths of seconds is a bit pointless. date would be more useful.
- Removed unneeded code after testing new date time format on HD arm screen. I needed to use actual aircraft as HITL doesn't support date/time over GPS.
- Updated date time format on SD arm screen
- Remove extra row if safehomes is not used
- Switched around format of safehome display for readability
- Arm screens will show stats if there is enough space to neatly do so
- Single row for long lat on SD, as there is plenty of space
- Tidied up all the `y + x` instances on SD arm screen, and made the variable name more explicit
Damn, I hate spaces. Tabs for alignment makes so much more sense :(
@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Oct 1, 2023

@mmosca @stronnag I'm getting issues with the Mac SITL checks.

@mmosca
Copy link
Collaborator

mmosca commented Oct 1, 2023 via email

@stronnag
Copy link
Collaborator

stronnag commented Oct 1, 2023

floorf maybe.

@stronnag
Copy link
Collaborator

stronnag commented Oct 1, 2023

floorf maybe.

logoColOffset = floorf((osdDisplayPort->cols - SYM_LOGO_WIDTH) / 2.0f);

fixes the issue in my (albeit old) MacOS VM

@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Oct 1, 2023

Thanks @stronnag

@MrD-RC MrD-RC removed the Don't merge label Oct 7, 2023
@MrD-RC MrD-RC merged commit 96549fc into master Oct 12, 2023
@MrD-RC MrD-RC deleted the MrD_HD-Arm-Screen branch October 12, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants