kopia lustrzana https://github.com/cyoung/stratux
Bugfix: Type error in track calculation.
rodzic
7e61c7556a
commit
2f4ed827e6
|
@ -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))))
|
||||
|
|
Ładowanie…
Reference in New Issue