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.
This commit is contained in:
Riccardo Mengoli
2024-12-10 09:20:53 +01:00
committed by GitHub
parent 430f0888b3
commit 09cd42911d
+4 -5
View File
@@ -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();