diff --git a/main/gps.go b/main/gps.go index 326f3421..b1347608 100644 --- a/main/gps.go +++ b/main/gps.go @@ -1939,10 +1939,8 @@ func makeAHRSGDL90Report() { if !isAHRSInvalidValue(mySituation.AHRSRoll) { roll = roundToInt16(mySituation.AHRSRoll * 10) } - if isAHRSInvalidValue(mySituation.AHRSGyroHeading) { - hdg = roundToInt16(mySituation.AHRSGyroHeading * 10) // TODO westphae: switch to AHRSMagHeading? - } else { - hdg = roundToInt16(float64(mySituation.GPSTrueCourse)) + if !isAHRSInvalidValue(mySituation.AHRSGyroHeading) { + hdg = roundToInt16(mySituation.AHRSGyroHeading * 10) } if !isAHRSInvalidValue(mySituation.AHRSSlipSkid) { slip_skid = roundToInt16(-mySituation.AHRSSlipSkid * 10) diff --git a/main/sensors.go b/main/sensors.go index f3cf227a..171c226f 100644 --- a/main/sensors.go +++ b/main/sensors.go @@ -277,7 +277,10 @@ func sensorAttitudeSender() { roll, pitch, heading = s.RollPitchHeading() mySituation.AHRSRoll = roll / ahrs.Deg mySituation.AHRSPitch = pitch / ahrs.Deg - mySituation.AHRSGyroHeading = heading / ahrs.Deg + mySituation.AHRSGyroHeading = heading + if !isAHRSInvalidValue(heading) { + mySituation.AHRSGyroHeading /= ahrs.Deg + } //TODO westphae: until magnetometer calibration is performed, no mag heading mySituation.AHRSMagHeading = ahrs.Invalid