From 6311d6275a970e9501d2c90a8edc2d2743d54d0b Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Thu, 12 Sep 2019 16:11:57 +0100 Subject: [PATCH] Client: Add ability to takeoff via animation setpoints --- Drone/FlightLib/FlightLib.py | 4 ++-- Drone/animation_lib.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Drone/FlightLib/FlightLib.py b/Drone/FlightLib/FlightLib.py index d5a6c53..b7dae37 100644 --- a/Drone/FlightLib/FlightLib.py +++ b/Drone/FlightLib/FlightLib.py @@ -163,8 +163,8 @@ def selfcheck(): return checks -def navto(x, y, z, yaw=float('nan'), frame_id=FRAME_ID, **kwargs): - set_position(frame_id=frame_id, x=x, y=y, z=z, yaw=yaw) +def navto(x, y, z, yaw=float('nan'), frame_id=FRAME_ID, auto_arm=False, **kwargs): + set_position(frame_id=frame_id, x=x, y=y, z=z, yaw=yaw, auto_arm=auto_arm) #telemetry = get_telemetry(frame_id=frame_id) logger.info('Going to: | x: {:.3f} y: {:.3f} z: {:.3f} yaw: {:.3f}'.format(x, y, z, yaw)) diff --git a/Drone/animation_lib.py b/Drone/animation_lib.py index cb5d681..d253a0c 100644 --- a/Drone/animation_lib.py +++ b/Drone/animation_lib.py @@ -108,7 +108,7 @@ def correct_animation(frames, frame_delay=0.1, min_takeoff_height=0.5, move_delt # If copter lands in animation, landing points can be deleted if (corrected_frames[len(corrected_frames)-1]['z'] < min_takeoff_height) and check_land: for i in range(len(corrected_frames)-1,0,-1): - print i + # print i if abs(corrected_frames[i-1]['z'] - corrected_frames[i]['z']) > move_delta: break del corrected_frames[i] @@ -133,11 +133,11 @@ def convert_frame(frame): def execute_frame(point=(), color=(), yaw=float('Nan'), frame_id='aruco_map', use_leds=True, - flight_func=FlightLib.navto, flight_kwargs=None, interrupter=interrupt_event): + flight_func=FlightLib.navto, auto_arm=False, flight_kwargs=None, interrupter=interrupt_event): if flight_kwargs is None: flight_kwargs = {} - flight_func(*point, yaw=yaw, frame_id=frame_id, interrupter=interrupt_event, **flight_kwargs) + flight_func(*point, yaw=yaw, frame_id=frame_id, auto_arm=auto_arm, interrupter=interrupt_event, **flight_kwargs) if use_leds: if color: LedLib.fill(*color)