play_animation: modify takeoff and land functions

This commit is contained in:
Arthur Golubtsov
2019-03-22 08:59:29 +00:00
parent ce2136bdc0
commit c916cc886d

View File

@@ -9,16 +9,19 @@ animation_file_path = 'animation.csv'
USE_LEDS = True
def takeoff(z=1.0, timeout=1000):
def takeoff(z=1.5, safe_takeoff=True, timeout=5000):
if USE_LEDS:
LedLib.wipe_to(255, 0, 0)
FlightLib.takeoff(z=z, wait=True, timeout_takeoff = timeout) # TODO dont forget change back to takeoff
if safe_takeoff:
FlightLib.takeoff(z=z, wait=True, timeout_takeoff = timeout, emergency_land=True) # TODO dont forget change back to takeoff
else:
FlightLib.takeoff(z=z, wait=True, emergency_land=False)
def land():
def land(descend=False):
if USE_LEDS:
LedLib.blink(255, 0, 0)
FlightLib.land()
FlightLib.land(descend=descend)
if USE_LEDS:
LedLib.off()
@@ -28,7 +31,7 @@ def animate_frame(current_frame, x0=0.0, y0=0.0):
if USE_LEDS:
LedLib.fill(current_frame['red'], current_frame['green'], current_frame['blue'])
def reach_frame(current_frame, x0=0.0, y0=0.0, timeout=1000):
def reach_frame(current_frame, x0=0.0, y0=0.0, timeout=5000):
FlightLib.reach_point(current_frame['x']+x0, current_frame['y']+y0, current_frame['z'], yaw=1.57, timeout=timeout) # TODO yaw
if USE_LEDS:
LedLib.fill(current_frame['red'], current_frame['green'], current_frame['blue'])