Change M10 satellites field to sats, re-add number of sats check to auto_rx.py

pull/130/head
Mark Jessop 2019-03-04 21:01:47 +10:30
rodzic a3af48600f
commit 6abb11bc75
2 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -326,6 +326,7 @@ def telemetry_filter(telemetry):
# First Check: zero lat/lon
if (telemetry['lat'] == 0.0) and (telemetry['lon'] == 0.0):
logging.warning("Zero Lat/Lon. Sonde %s does not have GPS lock." % telemetry['id'])
logging.debug(str(telemetry))
return False
# Second check: Altitude cap.
@ -334,7 +335,15 @@ def telemetry_filter(telemetry):
logging.warning("Sonde %s position breached altitude cap by %d m." % (telemetry['id'], _altitude_breach))
return False
# Third check - is the payload more than x km from our listening station.
# Third check: Number of satellites visible.
if 'sats' in telemetry:
if telemetry['sats'] < 4:
logging.warning("Sonde %s can only see %d SVs - discarding position as bad." % (telemetry['id'],telemetry['sats']))
logging.debug(str(telemetry))
return False
# Fourth check - is the payload more than x km from our listening station.
# Only run this check if a station location has been provided.
if (config['station_lat'] != 0.0) and (config['station_lon'] != 0.0):
# Calculate the distance from the station to the payload.
@ -346,6 +355,7 @@ def telemetry_filter(telemetry):
if _info['straight_distance'] > config['max_radius_km']*1000:
_radius_breach = _info['straight_distance']/1000.0 - config['max_radius_km']
logging.warning("Sonde %s position breached radius cap by %.1f km." % (telemetry['id'], _radius_breach))
logging.debug(str(telemetry))
return False
# Payload Serial Number Checks

Wyświetl plik

@ -454,7 +454,7 @@ void M10TrimbleParser::printFrame() {
"\"dxlid\": \"%s\", "
"\"datetime\": \"%04d-%02d-%02dT%02d:%02d:%02dZ\", "
"%s" // Aux data
"\"satellites\": %d, "
"\"sats\": %d, "
"\"lat\": %.5f, "
"\"lon\": %.5f, "
"\"alt\": %.2f, "