OSD 2D map enhancements: configurable margins and reference line #10038
+107
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds two things to the current OSD 2D map implementation:
1 - configurable horizontal and vertical margins
2 - configurable, fixed, reference line at the center of the screen
Feature (2) draws a dashed line on the center of the map display, if using "up is north" setting. The line is aligned at the heading set by a configurable parameter. The idea is to set this heading to the same heading as an easily recognizable and static feature nearby the place you are flying, for example the runway (if flying from a club), a nearby street or fence. So now you are able to compare the craft's position on the OSD map with this reference, making it easier to orientate yourself, better align directional antennas and so on. If set to -1 (the default setting), this line is disabled.
For now, these new parameters are only configurable via the CLI. If this PR gets accepted, the parameters could probably be added to the configurator UI. But since JScript is not my area of expertise, I will leave such a PR to be made by someone more comfortable with that.
A screenshot of the line enabled and configured (this shows being used with a Walksnail video system, but it's universal, working with analog and all digital setups supported by Inav, including DJI):
The light blue circle is the arrow which represents the craft's current position and heading (where the arrow is pointed to). The magenta ellipse marks the AHI line (artificial horizon, which works just fine together with the features from this PR). The red arrow points the reference line (feature added by this PR), configured to be aligned with the main runway (pointed to by the purple arrow).