Magnetic declination being "the direction of the horizontal component of
the magnetic field measured clockwise from north" according to
MagneticField(1), it must be substracted, not added, from true bearings
in order to obtain the corresponding magnetic bearings.
Example illustrating the bug:
Start at KSFO, open Equipment -> GPS Settings, enter KHTH as the
destination and click on "Search". Before the bug fix, the dialog
gives a bearing of 85, whereas the correct magnetic bearing is 58.
Digging a bit further, the true bearings/azimuths for the shortest
path (geodesic line) from KSFO to KHTH are approx. 71.5 at KSFO and
73.8 at KHTH. This can be verified with two independent libraries
(GeographicLib and PROJ.4):
% echo "37d37'08N 122d22'30W 38d32'45N 118d38'00W" | \
GeodSolve -i
71.44943076 73.75785283 343987.398
% echo "37d37'08N 122d22'30W 38d32'45N 118d38'00W" | \
geod +ellps=WGS84 -I -f '%0.3f'
71.449 -106.242 343987.398
(-106.242 + 180 = 73.758: -106.242 is the "back azimuth" at KHTH for
this path)
The bearing of 85 given by the code in gui/dialogs/gps.xml before
this commit is indeed 71.5 + magnetic declination at the starting
point (KSFO), whereas it should be 71.5 - magnetic declination.
Another, more experimental way:
Start FlightGear with:
fgfs --aircraft=ufo --disable-real-weather-fetch \
'--metar=KSFO 070956Z 36000KT 10SM FEW023 11/07 A2977 RMK AO2 SLP080 T01060067' \
--lat=37.61867421 --lon=-122.37500761 --heading=71.45931
(just in case wind influences the ufo, I have no idea whether this is
the case or not...)
During your flight, progressively increase your heading (as seen in
the HUD, i.e., true heading) so that it smoothly changes from 71.5 at
KSFO to 73.8 at KHTH. You should arrive pretty close to KHTH, whereas
the initial heading of 85 given by the GPS Settings dialog is way too
high, be it interpreted as a magnetic heading (which was visibly the
intention---it would be nice to write that in the dialog BTW) or as a
true heading (in which case the result is even further from the
correct value).
expose the ai-range-mode flag to the static-lod dialog.
PagedLOD culling based on distance seems to be more reliable than that based
on projected screen size.
This is merge request #20
MP Patch first step fgdata part: nasal to check wich planes we are
displaying in the futur, with a distance check , one plane each frame.
The change introduced in commit 8c7fc119 to go to the last checklist
on open causes a problem when the first checklist has multiple pages.
If the last opened checklist did not have multiple pages, the previous
and next page buttons are still shown.
This commit runs the same binding as used by the combo box to reset
the visibility of these buttons immediately before the page is
displayed.
The change introduced in commit 8c7fc119 to go to the last checklist
on open causes a problem when the first checklist has multiple pages.
If the last opened checklist did not have multiple pages, the previous
and next page buttons are still shown.
This commit runs the same binding as used by the combo box to reset
the visibility of these buttons immediately before the page is
displayed.
Now that request-metar/clear-metar commands work properly, use those
instead of direct manipulation of metar properties. Also, don't write
to properties intended for read-only use.
Replaces existing Nasal/failures.nas script with a programmable failure
manager. The failure manager allows dynammic creation and removal of
failure modes, on demand activation and a flexible set of triggers.
The public interface can be found in Nasal/FailureMgr/public.nas
Aircraft/Generic/Systems/failures.nas provides a library of triggers and
failure actuators ready to use for programming the failure manager.
A compatibility layer is included under
Aircraft/Generic/Systems/compat_failure_modes.nas.
This compatibility layer is currently loaded on startup and programs the
FailureMgr to emulate the former behavior (same set of failure modes and
compatible interface through the property tree).
This first milestone is only intended to replace the failure management
engine underneeth with minimum visible changes, and hopefully no aircraft
breakages. Future milestones will build upon this to add a Canvas based
procedural GUI and example integration on aircrafts.
Fix the main bugs, add features and convert most of the layers.
Move/refactor some things as well. Add a canvas map dialog next to the
built-in one -- it's not 100% functional but it's quite close actually.
As before, the excitement has been taking place at our team clone.
https://gitorious.org/fg/canvas-hackers-fgdata/commits/0b4cc84
(topics/canvas-map-dialog branch this time, current HEAD in above URL.)