Fix gdl90 AHRSGyroHeading reporting.

pull/720/head
Eric Westphal 2018-05-28 08:30:32 -04:00
rodzic c0127928af
commit 006824ef8d
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

@ -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