The framework enables convenient embedding and animation of a primary flight display. Styles and colors are easily tuned whilst maintaining crisp graphics for any screen resolution.
Key features include:
- Artificial horizon
- Pitch ladder
- Bank indicator
- Heading tape indicator
- Airspeed / Groundspeed tape indicator
- Altitude tape indicator
- Crisp procedurally generated graphics
- Highly configurable colors, sizes, and tape indicator scales
- No library dependenices other than Apple’s SpriteKit
- Flight stack and protocol agnostic
How to add a Primary Flight Display
Construct a new
PrimaryFlightDisplayView with default styles, and add it to your view hierarchy.
Send flight data to the primary flight display using the following API methods. The new flight data values will be animated immediately, and you’re done!
The styles for the default primary flight display are easily tuned, see Settings.swift for all the tuneable styles. As an exercise, let’s set the styles to create the primary flight display in the screenshot below.
Start with the default settings.
Change the ground color to brown.
Change the sky pointer color to pink, increase the bank indicator arc maximum degree to
75 and reduce the arc radius slightly to
Set the attitude reference index to pink and reduce its size slightly so it fits within the smaller bank indicator radius.
Make the heading indicator wider and slimmer, display a minor marker every degree and a major marker every
10 degrees. Increase the points (virtual pixels ) per unit value to
8, which means the numbers on the tape indicator are more spread out.
Construct a new primary flight display view with the custom settings, and add it to your view hierarchy.
MavlinkPrimaryFlightDisplay is a Mac app which demonstrates how to integrate the PrimaryFlightDisplay framework for a MAVLink speaking autopilot. Clone the repo and follow the
README to get the app running and connect to your autopilot.
The demo app is useful as a learning tool in several other ways as it demonstrates how to: