Revert "A3XX: FMGC: Add proper NAV tracking with better waypoint turning/etc"

This reverts commit b9a82d9278.
This commit is contained in:
Joshua Davidson 2017-11-17 20:31:47 -05:00
parent b2699b133d
commit ea0db7b865
3 changed files with 6 additions and 36 deletions

View file

@ -80,7 +80,6 @@ var APinit = func {
setprop("/it-autoflight/internal/heading-error-deg", 0); setprop("/it-autoflight/internal/heading-error-deg", 0);
trkfpa_off(); trkfpa_off();
ap_varioust.start(); ap_varioust.start();
lnavCalc.start();
thrustmode(); thrustmode();
} }
@ -551,39 +550,6 @@ var ap_various = func {
} }
} }
var lnavCalc = maketimer(0.05, func {
var f = flightplan();
var total_distance = getprop("/autopilot/route-manager/total-distance");
var distance = total_distance - getprop("/autopilot/route-manager/distance-remaining-nm");
var destination_elevation = getprop("/autopilot/route-manager/destination/field-elevation-ft");
var leg = f.currentWP();
if (leg == nil) {
setprop("/it-autoflight/input/lat", 3);
return;
}
var groundspeed = getprop("/velocities/groundspeed-kt");
var log_distance = getprop("/instrumentation/gps/wp/wp[1]/distance-nm");
var along_route = total_distance - getprop("/autopilot/route-manager/distance-remaining-nm");
var geocoord = geo.aircraft_position();
var referenceCourse = f.pathGeod(f.indexOfWP(f.destination_runway), -getprop("/autopilot/route-manager/distance-remaining-nm"));
var courseCoord = geo.Coord.new().set_latlon(referenceCourse.lat, referenceCourse.lon);
var CourseError = (geocoord.distance_to(courseCoord) / 1852) + 1;
var change_wp = abs(getprop("/autopilot/route-manager/wp/bearing-deg") - getprop("/orientation/heading-deg"));
if (change_wp > 180) {
change_wp = (360 - change_wp);
}
CourseError += (change_wp / 20);
var targetCourse = f.pathGeod(f.indexOfWP(f.destination_runway), (-getprop("autopilot/route-manager/distance-remaining-nm") + CourseError));
courseCoord = geo.Coord.new().set_latlon(targetCourse.lat, targetCourse.lon);
CourseError = (geocoord.course_to(courseCoord) - getprop("/orientation/heading-deg"));
if (CourseError < -180) {
CourseError += 360;
} else if (CourseError > 180) {
CourseError -= 360;
}
setprop("/it-autoflight/internal/lnav-error-deg", CourseError);
});
var flch_on = func { var flch_on = func {
setprop("/it-autoflight/output/appr-armed", 0); setprop("/it-autoflight/output/appr-armed", 0);
setprop("/it-autoflight/output/vert", 4); setprop("/it-autoflight/output/vert", 4);

View file

@ -487,7 +487,11 @@
<value>1</value> <value>1</value>
</equals> </equals>
</condition> </condition>
<property>/it-autoflight/internal/lnav-error-deg</property> <property>/autopilot/settings/true-heading-deg</property>
<offset>
<property>/orientation/heading-deg</property>
<scale>-1.0</scale>
</offset>
</input> </input>
<input> <input>
<condition> <condition>

View file

@ -1 +1 @@
4010 4009