From 23df9c9c2ebfafa9820a4d145132af9d854dc0a4 Mon Sep 17 00:00:00 2001 From: Eric Westphal Date: Sun, 2 Apr 2017 10:26:23 -0400 Subject: [PATCH] Slip/skid indicates correctly in UDP; limit UI slip/skid to 10 deg max. --- main/gps.go | 2 +- web/plates/js/ahrs.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main/gps.go b/main/gps.go index affc6eba9..85fe39ff2 100644 --- a/main/gps.go +++ b/main/gps.go @@ -1820,7 +1820,7 @@ func makeAHRSGDL90Report() { pitch = roundToInt16(mySituation.AHRSPitch * 10) roll = roundToInt16(mySituation.AHRSRoll * 10) hdg = roundToInt16(mySituation.AHRSGyroHeading * 10) // TODO westphae: switch to AHRSMagHeading? - slip_skid = roundToInt16(mySituation.AHRSSlipSkid * 10) + slip_skid = roundToInt16(-mySituation.AHRSSlipSkid * 10) yaw_rate = roundToInt16(mySituation.AHRSTurnRate * 10) g = roundToInt16(mySituation.AHRSGLoad * 10) } diff --git a/web/plates/js/ahrs.js b/web/plates/js/ahrs.js index 7844b7817..5fffd5559 100644 --- a/web/plates/js/ahrs.js +++ b/web/plates/js/ahrs.js @@ -113,6 +113,11 @@ AHRSRenderer.prototype = { this.roll = roll; this.heading = heading; this.slipSkid = slipSkid; + if (this.slipSkid < -10) { + this.slipSkid = -10; + } else if (this.slipSkid > 10) { + this.slipSkid = +10; + } this.pitchClip.translate(0, -10 * this.pitch); this.rollClip.rotate(this.roll, 0, 0);