From 38eca426c03946cc42d7d683c09fefba324f19bf Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 12 Jun 2012 11:49:20 +0100 Subject: reduced lag in GUI --- wim.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'wim.py') diff --git a/wim.py b/wim.py index b3ecbb6..9daf13b 100755 --- a/wim.py +++ b/wim.py @@ -82,7 +82,7 @@ GUI_IP="0.0.0.0" GUI_PORT=5400 insock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) insock.bind( (GUI_IP,GUI_PORT) ) -insock.settimeout(0.05) #non blocking, this sets the frame rate of checking +insock.settimeout(0.01) #non blocking, this sets the frame rate of checking PD_IP="127.0.0.1" PD_PORT=5401 outsock = socket.socket( socket.AF_INET,socket.SOCK_DGRAM ) @@ -96,12 +96,13 @@ while True: data="" try: data, addr = insock.recvfrom(128) - pos.parse(data) if debug==True: print "wim: received:",data + pos.parse(data) posChanged=True except: - nothing=None + nothing=None + if gpsp!="": #gps available if gpsp.fix>1: gpsfix=True @@ -125,5 +126,5 @@ while True: print "wim: sending:",str(r[0]),str(r[1]) #pd needs \n at end of message outsock.sendto( str(r[0])+' '+str(r[1])+'\n', (PD_IP, PD_PORT) ) - time.sleep(1.0) + time.sleep(0.01) -- cgit v1.2.3