mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 23:19:33 +00:00
play_animation: add reach_frame function and add timeout for takeoff and reach_frame
This commit is contained in:
@@ -9,10 +9,10 @@ animation_file_path = 'animation.csv'
|
||||
USE_LEDS = True
|
||||
|
||||
|
||||
def takeoff(z=1.0):
|
||||
def takeoff(z=1.0, timeout=1000):
|
||||
if USE_LEDS:
|
||||
LedLib.wipe_to(255, 0, 0)
|
||||
FlightLib.takeoff(z=z, wait=True) # TODO dont forget change back to takeoff
|
||||
FlightLib.takeoff(z=z, wait=True, timeout_takeoff = timeout) # TODO dont forget change back to takeoff
|
||||
|
||||
|
||||
def land():
|
||||
@@ -28,6 +28,11 @@ 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):
|
||||
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'])
|
||||
|
||||
|
||||
def read_animation_file(filepath=animation_file_path):
|
||||
imporetd_frames = []
|
||||
|
||||
Reference in New Issue
Block a user