diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-06-12 11:49:20 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-06-12 11:49:20 +0100 |
| commit | 38eca426c03946cc42d7d683c09fefba324f19bf (patch) | |
| tree | a47655c181c02e849dc0a401696c2b68e7fadf0e /wim.py | |
| parent | cd3ff8be099394651de63372b3c35d8e125ed0e0 (diff) | |
reduced lag in GUI
Diffstat (limited to 'wim.py')
| -rwxr-xr-x | wim.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) |
