mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 07:07:58 +00:00
drone: Fix animation module
This commit is contained in:
@@ -445,10 +445,12 @@ class Animation(object):
|
||||
self.mark_flight()
|
||||
|
||||
def get_start_frame(self, action):
|
||||
try:
|
||||
if action == 'fly':
|
||||
return self.output_frames[self.start_frame_index]
|
||||
if action == 'takeoff':
|
||||
return self.output_frames_takeoff[self.start_frame_index]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
def get_output_frames(self, action):
|
||||
@@ -470,6 +472,7 @@ class Animation(object):
|
||||
if not self.output_frames:
|
||||
return 'error: empty output frames'
|
||||
# Check current_height
|
||||
if self.config.animation_check_ground:
|
||||
if math.isnan(current_height):
|
||||
return 'error: bad copter height'
|
||||
# Select start action
|
||||
@@ -491,6 +494,7 @@ class Animation(object):
|
||||
else:
|
||||
return 'error in [ANIMATION] start_action parameter'
|
||||
# Check that bottom point of animation is higher than ground level
|
||||
if self.config.animation_check_ground:
|
||||
try:
|
||||
ground_level = self.config.animation_ground_level
|
||||
if ground_level == 'current':
|
||||
|
||||
Reference in New Issue
Block a user