Bugfix: Type error in track calculation.

pull/36/head
Christopher Young 2015-09-11 12:29:42 -04:00
rodzic 7e61c7556a
commit 2f4ed827e6
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -269,7 +269,7 @@ func parseDownlinkReport(s string) {
if ns_vel_valid && ew_vel_valid {
if ns_vel != 0 && ew_vel != 0 {
//TODO: Track type
track = (360 + 90 - (uint16(math.Atan2(float64(ns_vel), float64(ew_vel)) * 180 / math.Pi))) % 360
track = uint16((360 + 90 - (int16(math.Atan2(float64(ns_vel), float64(ew_vel)) * 180 / math.Pi))) % 360)
}
speed_valid = true
speed = uint16(math.Sqrt(float64((ns_vel * ns_vel) + (ew_vel * ew_vel))))