From ca36b1d3b1ffa74052a4b2a42d0b5868915fa4ca Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 16 Apr 2015 18:27:55 +0200 Subject: btn_unlock + new gamepad --- server.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index c44c7b4..08d26a8 100644 --- a/server.py +++ b/server.py @@ -185,11 +185,12 @@ while True: if no_flight == False: pygame.event.pump() - btn_leftshoulder = js.get_button(4) or js.get_button(6) - btn_rightshoulder = js.get_button(5) or js.get_button(7) + btn_leftshoulder = js.get_button(4) or js.get_button(5) + btn_rightshoulder = js.get_button(6) or js.get_button(7) btn_thumb = js.get_button(0) or js.get_button(1) or js.get_button(2) or js.get_button(3) btn_all = js.get_button(0) and js.get_button(1) and js.get_button(2) and js.get_button(3) - btn_readjust = js.get_button(10) + btn_readjust = js.get_button(8) + btn_unlock = js.get_button(9) if btn_thumb: drone.land() @@ -197,7 +198,7 @@ while True: manual_override_xy = True manual_override_z = True manual_override_rot = True - if btn_leftshoulder and btn_rightshoulder and js.get_button(10): + if btn_leftshoulder and btn_rightshoulder and js.get_button(8): drone.takeoff() print "taking off" manual_override_xy = True @@ -211,6 +212,8 @@ while True: manual_override_rot = True if btn_readjust: js_angle_shift = drone.navdata.get(0, dict()).get('psi',0) + if btn_unlock: + manual_override_rot = False rel_angle = (drone.navdata.get(0, dict()).get('psi',0) - js_angle_shift)/180.*math.pi -- cgit v1.2.3