diff options
author | Florian Jung <flo@windfisch.org> | 2015-04-16 18:27:55 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-04-16 18:27:55 +0200 |
commit | ca36b1d3b1ffa74052a4b2a42d0b5868915fa4ca (patch) | |
tree | 4dea4d7812a59f0012261e91fd5b41245f012fa8 | |
parent | 677ee6b0a2d9e0903241a94b43c34bd06a3d31fb (diff) |
btn_unlock + new gamepad
-rw-r--r-- | server.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |