Fix calculation of vertical rate

The sign bit was incorrectly included in the vertical rate calculation, which resulted in all negative vertical rates being -255 or smaller
This commit is contained in:
Thomas Robitaille 2016-08-15 10:08:58 +01:00 committed by GitHub
parent 8ef02fa2b1
commit 2ee87c8c61

View File

@ -344,7 +344,7 @@ def velocity(msg):
tag = 'AS'
vr_sign = util.bin2int(msgbin[68])
vr = util.bin2int(msgbin[68:77]) # vertical rate
vr = util.bin2int(msgbin[69:77]) # vertical rate
rocd = -1*vr if vr_sign else vr # rate of climb/descend
return int(spd), round(hdg, 1), int(rocd), tag