summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2016-02-03 01:31:16 +0100
committerFlorian Jung <flo@windfisch.org>2016-02-03 01:31:16 +0100
commitcc265d74634bfc0fd942dcfdd91c4ba2ade1fede (patch)
tree87e715a3d1229f9bd8b2fbb0ad27c88cadf2883a
parent65a270739ee8e09a33670c2c3f8af7db4bd3b3b2 (diff)
stuff
-rw-r--r--client2.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/client2.cpp b/client2.cpp
index 7049725..0f1dbb8 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=90/180.*3.141592654;\n"
+ "const float horiz_field_of_view=50/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"
@@ -590,7 +590,7 @@ void* video_fetcher_thread(void* ptr)
Ringbuffer delay_psi(DELAY_SIZE); // that's the amount the video lags behind
Ringbuffer delay_theta(DELAY_SIZE); // the sensor data
- #define CMDLAG_SIZE 8
+ #define CMDLAG_SIZE 6
// 5: still overshoots but much more stable
// 7: overshoots a tiny bit
// 8: cool!
@@ -736,7 +736,9 @@ void* video_fetcher_thread(void* ptr)
printf("drone fps is %i\n",droneFPS);
float extrapolated_yaw_cam = yaw_cam*PI/180. + pending_commands.sum()*(1.0/droneFPS);
float yawdiff = fixup_angle(target_yaw - extrapolated_yaw_cam);
- float rotate = saturate(yawdiff*5., 10.);
+ yawdiff = deadzone(yawdiff, 5.*PI/180.);
+ float rotate = saturate( (yawdiff*5.)*fabs(yawdiff*5.) , 4.);
+ //float rotate = saturate(yawdiff*5., 4.);
drone.fly(0.,0.,0.,rotate);
pending_commands.put(rotate);