A3XX: Fix some FMGC bugs, #110

This commit is contained in:
Joshua Davidson 2017-12-15 23:04:11 -05:00
parent 7aa19c4e00
commit edc4f9b1d6
2 changed files with 11 additions and 5 deletions

View file

@ -28,6 +28,7 @@ setlistener("/sim/signals/fdm-initialized", func {
var gear2 = getprop("/gear/gear[2]/wow");
var gnds_mps = 0;
var current_course = 0;
var wp_fly_from = 0;
var wp_fly_to = 0;
var next_course = 0;
var max_bank_limit = 0;
@ -224,6 +225,7 @@ var fmabox = func {
# Master Lateral
setlistener("/it-autoflight/input/lat", func {
if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/gear/gear[2]/wow") == 0)) {
setprop("/it-autoflight/input/lat-arm", 0);
lateral();
} else {
lat_arm();
@ -554,12 +556,16 @@ var ap_various = func {
if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1) {
gnds_mps = getprop("/velocities/groundspeed-kt") * 0.5144444444444;
current_course = getprop("/instrumentation/gps/wp/leg-true-course-deg");
wp_fly_from = getprop("/autopilot/route-manager/current-wp");
if (wp_fly_from < 0) {
wp_fly_from = 0;
}
current_course = getprop("/autopilot/route-manager/route/wp[" ~ wp_fly_from ~ "]/leg-bearing-true-deg");
wp_fly_to = getprop("/autopilot/route-manager/current-wp") + 1;
if (wp_fly_to < 0) {
wp_fly_to = 0;
}
next_course = getprop("/autopilot/route-manager/route/wp["~wp_fly_to~"]/leg-bearing-true-deg");
next_course = getprop("/autopilot/route-manager/route/wp[" ~ wp_fly_to ~ "]/leg-bearing-true-deg");
max_bank_limit = getprop("/it-autoflight/internal/bank-limit");
delta_angle = math.abs(geo.normdeg180(current_course - next_course));
@ -567,8 +573,8 @@ var ap_various = func {
if (max_bank > max_bank_limit) {
max_bank = max_bank_limit;
}
radius = (gnds_mps * gnds_mps) / (9.81 * math.tan(max_bank/57.2957795131));
time = 0.64 * gnds_mps * delta_angle * 0.7 / (360 * math.tan(max_bank/57.2957795131));
radius = (gnds_mps * gnds_mps) / (9.81 * math.tan(max_bank / 57.2957795131));
time = 0.64 * gnds_mps * delta_angle * 0.7 / (360 * math.tan(max_bank / 57.2957795131));
delta_angle_rad = (180 - delta_angle) / 114.5915590262;
R = radius/math.sin(delta_angle_rad);
dist_coeff = delta_angle * -0.011111 + 2;

View file

@ -1 +1 @@
4070
4071