Skip to main content

Panorama Mission Tutorial

1. Mission Overview

In this tutorial, you will learn how to perform a panoramic photo shooting mission. With just one tap, the aircraft can take a panoramic shoot, automatically stitch a panorama, and enable you to preview the panorama in the album.

This mission supports four panorama modes: Horizontal, Vertical, 180° and Sphere.

In Horizontal, Vertical, and 180° mode, the aircraft will automatically stitch photos after the shooting. However, in Sphere mode, automatic panorama stitching is not supported.

You can import panoramic photos taken by the aircraft to your computer and use the panorama photo stitching software to produce a larger panoramic photo.

In this tutorial, you will learn how to instruct the aircraft to perform a panoramic photo shooting mission by using the APIs provided by the Intelligent Mission Module of the Mobile SDK.

2. Panorama Mission Flow

Panorama mission flow

3. Key Classes and APIs

Enumeration definition of panorama modes

/**
* Types of panoramic photography
*
* Types of panoramic photography
*/
typedef NS_ENUM(uint8_t, AUTELPanoramicPhotoType ) {
/**
* @brief horizontal shot
*
* Horizontal
*/
AUTELPanoramicPhotoTypeHorizontal,

/**
* @brief vertical shot
*
* Vertical
*/
AUTELPanoramicPhotoTypeVertical,

/**
* @brief wide angle shot
*
* 180°
*/
AUTELPanoramicPhotoTypeWideAngle,

/**
* @brief spherical shot
*
* Sphere
*/
AUTELPanoramicPhotoTypeSpherical,

};

Enumeration definition of the current mission execution status

/**
* Panorama photo current status
*
* Current status of the panorama mission
*/
typedef NS_ENUM(uint8_t, AUTELCameraPanoramicPhotoStatus ) {
/**
* @brief Stop
*
* Shooting stopped
*/
AUTELCameraPanoramicPhotoStatusStop = 0,

/**
* @brief Taking Photo
*
* Shooting in progress
*/
AUTELCameraPanoramicPhotoStatusTakingPhoto = 1,

/**
* @brief Stitching Photo
*
* Photos being stitched
*/
AUTELCameraPanoramicPhotoStatusStitching = 2,

/**
* @brief Pause
*
* Mission paused
*/
AUTELCameraPanoramicPhotoStatusPause = 10,

};

Handle of the manager class of the panorama mission

/**
* Protocols for Panoramic photo mission are used to start, pause, resume, and exit the mission.
*
* The handle of the task manager class for handling the panorama mission is used for starting and stopping the mission.
*
* @see AUTELPanoramicPhotoMissionStatus
*/
@protocol AUTELPanoramicPhotoMissionHandler <AUTELMissionHandler>

/// Set Panoramic photo mission parameters.
/// @param misstion Set the photo type of the panorama photo mission.
/// @param block completion block
- (void)setPanoramicPhotoInfo:(AUTELPanoramicPhotoMission *)misstion withCompletion:(AUTELCompletionBlock)block;

Encapsulated data model for the panorama mission

/**
* This class includes Panorama photo mission related functions.
*
* The encapsulated data model for the panorama mission is used for setting the mission type and uploading mission data
*/
@interface AUTELPanoramicPhotoMission : AUTELMission<NSCopying>

/**
* @brief Panoramic photo shooting type.
*
* Panoramic photo shooting type.
*/
@property (nonatomic, assign) AUTELPanoramicPhotoType shotType;

Definition of the class for updating the panorama mission status

/**
* The real-time status of the Panorama photo mission. When the aircraft is executing the Panorama photo mission, the status is updated in real time by the -onNavigationMissionStatusChanged: method of AUTELNavigationDelegate.
*
* Real-time status of the panorama mission. When the aircraft is shooting a panoramic photo, the status is updated in real time by -onNavigationMissionStatusChanged: of AUTELNavigationDelegate.
*
*/
@interface AUTELPanoramicPhotoMissionStatus : AUTELMissionProgressStatus

API for reporting the status of the panorama mission

/**
* @brief Enter the panoramic photo mission, the camera reports the panoramic photo status information in real time
*
* When the panorama mission is started, the camera reports the mission status in real time.
*
* @param misstionStauts see AUTELPanoramicPhotoMissionStatus
*
* Panoramic photo shooting status
*
* @see AUTELPanoramicPhotoMissionStatus
*/
- (void)onMissionPanoramicPhotoStatusUpdateNote:(AUTELPanoramicPhotoMissionStatus* _Nonnull)misstionStauts;

4. Implement the Panorama Mission

1. Report the Listened Mission Status

Register to receive and report the listened mission status and camera status data
AUTELNavigationDelegateConnection.shared.addProtocol(self)
CameraConnection.shared.addProtocol(self)
Report the listened mission status
func onMissionPanoramicPhotoStatusUpdateNote(_ misstionStauts: AUTELPanoramicPhotoMissionStatus) {
DispatchQueue.main.async {

}
}

The parameters of AUTELPanoramicPhotoMissionStatus are defined as follows:

ParameterTypeDescription
panoramicPhotoStatusAUTELCameraPanoramicPhotoStatusCurrent status of the mission: Photo being taken, Photo being stitched, Paused, and Idle
currentStepNSUIntegerCurrent step for panoramic photo shooting, which is the number of photos that has been taken
totalStepNSUIntegerTotal number of steps for panoramic photo shooting, which is the number of required photos that need to be taken for this mission
proportionfloatPhoto stitching progress
Report the status of the listened file generation event
//The camera successfully generates a new media file
func camera(_ camera: AUTELBaseCamera!, didGenerateNewMediaFile newMedia: AUTELMedia!) {

}

2. Set the Panoramic Photo Shooting Type

Use DroneConnection.shared.drone?.mainController.navigationManager.panoramicPhotoMissionHandle to set the panoramic photo shooting type. You can select Horizontal, Vertical, 180°, and Sphere.

 var mission: AUTELPanoramicPhotoMission = AUTELPanoramicPhotoMission.init()
mission.shotType = .horizontal

DroneConnection.shared.drone?.mainController.navigationManager.panoramicPhotoMissionHandler.setPanoramicPhotoInfo(mission, withCompletion: { [weak self] (error) in
if let err = error {

} else {

}
})

3. Start the Mission

Before you start the mission, perform the following steps:

  1. Configure the mission data model
  2. Set the panoramic shooting type
  3. Upload the mission data
  4. Start performing the mission
//1. Configure the mission data model
let mission: AUTELPanoramicPhotoMission = AUTELPanoramicPhotoMission()
//2. Set the panoramic shooting type
mission.shotType = .horizontal
//3. Upload the mission data
DroneConnection.shared.drone?.mainController.navigationManager.panoramicPhotoMissionHandler.prepare(mission, withProgress: { progress in

}, withCompletion: { [weak self] error in
guard let selfs = self else { return }

if let err = error {

DispatchQueue.main.async {

}

return
}

//4. Start performing the mission
DroneConnection.shared.drone?.mainController.navigationManager.panoramicPhotoMissionHandler.startMissionExecution(completion: { [weak self] startMissionErr in

guard let selfs = self else { return }

if let err = startMissionErr {

DispatchQueue.main.async {

}
} else {
DispatchQueue.main.async {


}
}
})
})

4. Stop the Mission

When a panorama mission is being performed, you can call the following method to stop the mission. After you stop the mission, the aircraft will hover in the air.

DroneConnection.shared.drone?.mainController.navigationManager.panoramicPhotoMissionHandler.stopMissionExecution(completion: { [weak self] (error) in
DispatchQueue.main.async {
guard let selfs = self else { return }

}
})

This is the end of the tutorial.