changeset 133:f1bfff22e35c

gpsd: fix bug
author Lewin Bormann <lbo@spheniscida.de>
date Thu, 06 May 2021 12:12:48 +0200
parents c2efa052fb50
children c7721d279d56
files examples/gpsd/gpsd.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/examples/gpsd/gpsd.py	Thu May 06 12:11:00 2021 +0200
+++ b/examples/gpsd/gpsd.py	Thu May 06 12:12:48 2021 +0200
@@ -8,6 +8,7 @@
 
 import argparse
 import json
+import math
 import sys
 import time
 
@@ -19,7 +20,7 @@
     geohub_url = geohub_templ.format(HOST=args.geohub_host, CLIENT=args.client, SECRET=args.secret, PROTOCOL=args.geohub_scheme)
     additional = '&lat={lat}&longitude={long}&s={spd}&time={ts}&unit=ms&accuracy={acc}&ele={ele}'.format(
             lat=info['lat'], long=info['lon'], spd=info['speed'], ts=info['time'],
-            acc=sqrt(info['epx']**2+info['epy']**2), ele=info['alt'])
+            acc=math.sqrt(info['epx']**2+info['epy']**2), ele=info['alt'])
     # Delete unnecessary data.
     url = geohub_url + additional
     return sess.post(url, data="")