From 6abb11bc75325ca8d050e38a74f5fb1f13f28391 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Mon, 4 Mar 2019 21:01:47 +1030 Subject: [PATCH] Change M10 satellites field to sats, re-add number of sats check to auto_rx.py --- auto_rx/auto_rx.py | 12 +++++++++++- m10/M10TrimbleParser.cpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/auto_rx/auto_rx.py b/auto_rx/auto_rx.py index de4df38..3587d95 100644 --- a/auto_rx/auto_rx.py +++ b/auto_rx/auto_rx.py @@ -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 diff --git a/m10/M10TrimbleParser.cpp b/m10/M10TrimbleParser.cpp index 7d64700..c492dd2 100644 --- a/m10/M10TrimbleParser.cpp +++ b/m10/M10TrimbleParser.cpp @@ -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, "