Merge pull request #70 from merspieler/master

Applied fixes to autopush
This commit is contained in:
Joshua Davidson 2018-12-23 21:35:13 -05:00 committed by GitHub
commit 2bdb70c600
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -42,7 +42,7 @@ var _loop = func() {
var time = getprop("/sim/time/elapsed-sec");
var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p);
var speedup = getprop("/sim/speed-up");
var deriv = 0;
var deriv = 0.0;
dt = time - _time;
# XXX Sanitising dt. Smaller chance of freakout on lag spike.
if(dt > 0.0) {
@ -50,7 +50,7 @@ var _loop = func() {
_int = math.min(math.max(_int + _K_i * dV * dt, -_F_i), _F_i);
}
if(dt > 0.002) {
var deriv = math.min(math.max(_K_d * dV / dt, -_F_d), _F_d);
deriv = math.min(math.max(_K_d * dV / dt, -_F_d), _F_d);
}
}
var accel = prop + _int + deriv;

View file

@ -34,7 +34,7 @@ var _loop = func() {
D *= NM2M;
# FIXME Use _K_V and total remaining distance.
var V = _F_V;
if ((D < _D_min) or (abs(geo.normdeg180(A - psi) > 90.0))) {
if ((D < _D_min) or (abs(geo.normdeg180(A - psi) > 45.0))) {
_to_wp += 1;
if (_to_wp == size(_route)) {
_done();