From 09cd42911d993544f50b4d1747f6beedbb9eb61b Mon Sep 17 00:00:00 2001 From: Riccardo Mengoli Date: Tue, 10 Dec 2024 09:20:53 +0100 Subject: [PATCH] Mission: Replay gimbal cached items before reaching mission waypoint (#24085) When flying patterns, photos are sometimes taken while the gimbal is pitching up or down. To address this, we orient the gimbal before reaching the mission waypoint, allowing more time to complete the action. Additionally, we verify if the vehicle is climbing to avoid orienting the gimbal while on the ground. --- src/modules/navigator/mission_base.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/navigator/mission_base.cpp b/src/modules/navigator/mission_base.cpp index 37f104dea2..0d653a1882 100644 --- a/src/modules/navigator/mission_base.cpp +++ b/src/modules/navigator/mission_base.cpp @@ -299,15 +299,14 @@ MissionBase::on_active() replayCachedCameraModeItems(); } + // Replay cached gimbal commands immediately upon mission resume, but only after the vehicle has reached the final target altitude + if (haveCachedGimbalItems() && _work_item_type != WorkItemType::WORK_ITEM_TYPE_CLIMB) { + replayCachedGimbalItems(); + } // Replay cached mission commands once the last mission waypoint is re-reached after the mission interruption. // Each replay function also clears the cached items afterwards if (_mission.current_seq > _mission_activation_index) { - // replay gimbal commands - if (haveCachedGimbalItems()) { - replayCachedGimbalItems(); - } - // replay trigger commands if (cameraWasTriggering()) { replayCachedTriggerItems();