summaryrefslogtreecommitdiff
path: root/server.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-01-22 20:50:43 +0100
committerFlorian Jung <flo@windfisch.org>2015-01-22 20:50:43 +0100
commit6d45dfebd2f0146e42778f9b0195ce788f7384a3 (patch)
tree8e466a0259730cde973fbbc612eae46f4d40ff83 /server.py
parentf88c8eab3ac10be727ab54adeccc19d58c35406c (diff)
configurable resolution
Diffstat (limited to 'server.py')
-rw-r--r--server.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/server.py b/server.py
index 4e56790..8cb50c0 100644
--- a/server.py
+++ b/server.py
@@ -8,6 +8,8 @@ import threading
import time
import struct
+OVERRIDE_THRESHOLD=0.01
+
def putStatusText(img, text, pos, activated):
cv2.putText(img, text, pos, cv2.FONT_HERSHEY_PLAIN, 1, (0,0,255) if activated else (127,127,127), 2 if activated else 1)
@@ -144,7 +146,7 @@ while True:
js_radius = math.sqrt(js_x**2 + js_y**2)
if btn_leftshoulder==0:
js_x, js_y = ( js_x * cos(rel_angle) + js_y * sin(rel_angle) ) , ( -js_x * sin(rel_angle) + js_y * cos(rel_angle) )
-
+
js_hover = (btn_rightshoulder==0 and (js_radius <= 0.01))
if (js_radius > OVERRIDE_THRESHOLD): manual_override_xy = True