summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-04-06 16:24:06 +0200
committerFlorian Jung <flo@windfisch.org>2015-04-06 16:24:06 +0200
commitf303c0d49e3e3e5089052d797f3ab2e821c01636 (patch)
tree65e1c33f0f701af18c78f3acdaf104e6d1b96c6c
parentb58cdc49ca4ab7f8c537486fca9eed4f1f70d1e7 (diff)
äh dingens
-rw-r--r--client2.cpp6
-rw-r--r--server.py19
2 files changed, 22 insertions, 3 deletions
diff --git a/client2.cpp b/client2.cpp
index 79a46b3..8d2e480 100644
--- a/client2.cpp
+++ b/client2.cpp
@@ -136,7 +136,7 @@ const char* drawFromCanvasFragmentSource =
"uniform float eye_pitch;\n"
"uniform float eye_roll;\n"
"const float aspect_ratio=1280./2/720.;\n"
- "const float horiz_field_of_view=60/180.*3.141592654;\n"
+ "const float horiz_field_of_view=90/180.*3.141592654;\n"
"const float CAM_FX=1/2.0 / tan(horiz_field_of_view/2.0);\n"
"const mat3 eye_cal_inv = transpose(mat3(1/CAM_FX, 0, -1/2/CAM_FX, 0, 1/CAM_FX, -1/aspect_ratio/2/CAM_FX, 0,0,1));\n"
"const mat3 opencv_to_math = mat3(0,1,0, 0,0,1, -1,0,0);\n"
@@ -657,8 +657,8 @@ void* video_fetcher_thread(void* ptr)
pitch_diff = deadzone(pitch_diff, 1.0);
roll_diff = deadzone(roll_diff, 1.0);
- yaw_diff*=0.1;
- pitch_diff*=0.1;
+ yaw_diff*=0.3;
+ pitch_diff*=0.3;
roll_diff*=0.5;
yaw_cam = fixup_range(yaw_cam - yaw_diff, -180, 180);
pitch_cam = pitch_cam - pitch_diff;
diff --git a/server.py b/server.py
index b4bd971..0adf238 100644
--- a/server.py
+++ b/server.py
@@ -29,6 +29,24 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# keyboard:
+# 1: enable xy control
+# 2: enable z control
+# 3: enable rot control
+# a: fast
+# z: slow
+# t: trim
+#
+#
+# joystick:
+# thumb: land
+# all four thumbbuttons: reset
+# left shoulder + right shoulder + 11: takeoff
+# 11: readjust
+# left shoulder: relative flight mode if held
+# right shoulder: float, do not hover, if held.
+
+
import libardrone.libardrone as libardrone
import pygame
import cv2
@@ -80,6 +98,7 @@ class ServerThread(threading.Thread):
global_cmd_rot = float(values[3])
global_cmd_hover = False # TODO XXX
lock.release()
+ print >>sys.stderr, "fly x/y/z/r/hov=",global_cmd_x,",",global_cmd_y,",","global_cmd_z",",",global_cmd_rot,",",global_cmd_hover
else:
print >>sys.stderr, 'no more data from', client_address
break