From 374829451bed4edb87cd5c21cfdcc24ed06b4c81 Mon Sep 17 00:00:00 2001 From: Tamas Nepusz Date: Sun, 9 Jul 2023 20:33:33 +0200 Subject: [PATCH] fix: fix RTH transition duration --- src/modules/sbstudio/plugin/operators/return_to_home.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/sbstudio/plugin/operators/return_to_home.py b/src/modules/sbstudio/plugin/operators/return_to_home.py index b1939a7e..c74723ec 100644 --- a/src/modules/sbstudio/plugin/operators/return_to_home.py +++ b/src/modules/sbstudio/plugin/operators/return_to_home.py @@ -7,6 +7,7 @@ from sbstudio.plugin.constants import Collections from sbstudio.plugin.model.formation import create_formation from sbstudio.plugin.model.safety_check import get_proximity_warning_threshold +from sbstudio.plugin.utils.evaluator import create_position_evaluator from .base import StoryboardOperator from .takeoff import create_helper_formation_for_takeoff_and_landing @@ -86,8 +87,11 @@ def _run(self, storyboard, *, context) -> bool: if not drones: return False + with create_position_evaluator() as get_positions_of: + source = get_positions_of(drones, frame=self.start_frame) + first_frame = storyboard.frame_start - source, target, _ = create_helper_formation_for_takeoff_and_landing( + _, target, _ = create_helper_formation_for_takeoff_and_landing( drones, frame=first_frame, base_altitude=self.altitude,