Fixed ground velocity return and updated velocity docstring
This commit is contained in:
@@ -151,9 +151,16 @@ def velocity(msg):
|
||||
msg (string): 28 bytes hexadecimal message string
|
||||
|
||||
Returns:
|
||||
(int, float, int, string): speed (kt), ground track or heading (degree),
|
||||
rate of climb/descend (ft/min), and speed type
|
||||
('GS' for ground speed, 'AS' for airspeed)
|
||||
(int, float, int, string, string, string): speed (kt),
|
||||
ground track or heading (degree),
|
||||
rate of climb/descent (ft/min), speed type
|
||||
('GS' for ground speed, 'AS' for airspeed),
|
||||
direction source ('gnd_trk' for ground track, 'mag_hdg' for
|
||||
magnetic heading), rate of climb/descent source ('Baro' for
|
||||
barometer, 'GNSS' for GNSS constellation).
|
||||
|
||||
In the case of surface messages, None will be put in place
|
||||
for direction, vertical rate, and their respective sources.
|
||||
"""
|
||||
|
||||
if 5 <= typecode(msg) <= 8:
|
||||
|
||||
@@ -147,9 +147,10 @@ def surface_velocity(msg):
|
||||
msg (string): 28 bytes hexadecimal message string
|
||||
|
||||
Returns:
|
||||
(int, float, int, string): speed (kt), ground track (degree),
|
||||
rate of climb/descend (ft/min), and speed type
|
||||
('GS' for ground speed, 'AS' for airspeed)
|
||||
(int, float, None, string, None, None): speed (kt),
|
||||
ground track (degree), None for rate of climb/descend (ft/min),
|
||||
and speed type ('GS' for ground speed), direction source
|
||||
('gnd_trk' for ground track), None rate of climb/descent source.
|
||||
"""
|
||||
|
||||
if common.typecode(msg) < 5 or common.typecode(msg) > 8:
|
||||
@@ -182,4 +183,4 @@ def surface_velocity(msg):
|
||||
spd = kts[i-1] + (mov-movs[i-1]) * step
|
||||
spd = round(spd, 2)
|
||||
|
||||
return spd, trk, 0, 'GS'
|
||||
return spd, trk, None, 'GS', None, None
|
||||
|
||||
Reference in New Issue
Block a user