From bffba1a91ef37a19a65bc8d7a1546fe0bf326f1a Mon Sep 17 00:00:00 2001 From: Comma Device Date: Tue, 18 May 2021 18:56:58 -0700 Subject: [PATCH] little helper script --- selfdrive/locationd/test/print_gps_stats.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 selfdrive/locationd/test/print_gps_stats.py diff --git a/selfdrive/locationd/test/print_gps_stats.py b/selfdrive/locationd/test/print_gps_stats.py new file mode 100755 index 0000000000..b5e89993a3 --- /dev/null +++ b/selfdrive/locationd/test/print_gps_stats.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +import time +import cereal.messaging as messaging + +if __name__ == "__main__": + sm = messaging.SubMaster(['ubloxGnss', 'gpsLocationExternal']) + + while 1: + ug = sm['ubloxGnss'] + gle = sm['gpsLocationExternal'] + + try: + cnos = [] + for m in ug.measurementReport.measurements: + cnos.append(m.cno) + print("Sats: %d Accuracy: %.2f m cnos" % (ug.measurementReport.numMeas, gle.accuracy), sorted(cnos)) + except: + pass + sm.update() + time.sleep(0.1)