Nav Radios and GPS

From X-Plane SDK
Jump to: navigation, search
This page contains partial documentation or copies of email threads, and needs clean-up and organization. If the information on this page is related to the plugin you are working on, please consider helping to organize the content.

First: it may not be possible to do what you want to do. There are some missing overrides in the SDK nav system - we simply never put them in - that make this kind of operation difficult.

Here's the key: you can't control via the SDK what navaid the various radio instruments are listening to (this is determined by the sim) and it is the current navaid that determines whether it _has signal_.

The process of updating whether the nav radio is getting signal is often bypassed by the override, but you can't set it.

So this is how you would make an HSI look like it has a GPS glide slope:

1. First, tune the real X-Plane GPS or FMS to have a valid course segment. If you don't do this, you will always have missing glide slope, or red flgas, or something else, because internally the GPS "radio" either has a valid course or it doesn't.

For my test, I inited the built in FMS and set waypoint 1 to the airport I was on and waypoint 2 to a nearby VOR, to get a nice red course line. When I do this (no other datarefs have been set yet) and tune my HSI to GPS, I go from a pile of red flags to a HSI showing me course info.

2. Then I set override_gps=1 so I can control deflections. At this point, I can write to gps_hdef_dot and gps_vdef_dot (units are "dots", e.g. 1.0, 1.5, etc.).

3. If I want to see the glide slope indicator, I now set gps_has_glideslope=1 otherwise any HSI that can hide its GS indicator will do so. If there is no conceptual glideslope associated with the GPS, there's nothing to see.

4. Finally _if_ you want the autopilot to FLY your GPS glide slope, make sure to set gps_slope_degt to something sane (uh I don't remember if it should be +3 or -3) because the AP uses this to estimate its target descent. If you leave it at zero the AP will follow the needles, but it will tend to trend behind the real plane progress since it has no ability to predict what "should" happen without slope info.

This logic goes for all of the nav radios, VORs too, not just the GPS.