Mission
public class Mission
Enable waypoint missions.
-
Initializes a new
Mission
plugin.Normally never created manually, but used from the
Drone
helper class instead.Declaration
Swift
public convenience init(address: String = "localhost", port: Int32 = 50051, scheduler: SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background))
Parameters
address
The address of the
MavsdkServer
instance to connect toport
The port of the
MavsdkServer
instance to connect toscheduler
The scheduler to be used by
Observable
s -
Undocumented
See moreDeclaration
Swift
public struct RuntimeMissionError : Error
-
Undocumented
See moreDeclaration
Swift
public struct MissionError : Error
-
Type representing a mission item.
A MissionItem can contain a position and/or actions. Mission items are building blocks to assemble a mission, which can be sent to (or received from) a system. They cannot be used independently.
See moreDeclaration
Swift
public struct MissionItem : Equatable
-
Mission plan type
See moreDeclaration
Swift
public struct MissionPlan : Equatable
-
Mission progress type.
See moreDeclaration
Swift
public struct MissionProgress : Equatable
-
Result type.
See moreDeclaration
Swift
public struct MissionResult : Equatable
-
Progress data coming from mission upload.
See moreDeclaration
Swift
public struct ProgressData : Equatable
-
Progress data coming from mission download, or the mission itself (if the transfer succeeds).
See moreDeclaration
Swift
public struct ProgressDataOrMission : Equatable
-
Upload a list of mission items to the system.
The mission items are uploaded to a drone. Once uploaded the mission can be started and executed even if the connection is lost.
Declaration
Swift
public func uploadMission(missionPlan: MissionPlan) -> Completable
Parameters
missionPlan
The mission plan
-
Upload a list of mission items to the system and report upload progress.
The mission items are uploaded to a drone. Once uploaded the mission can be started and executed even if the connection is lost.
Declaration
Swift
public func uploadMissionWithProgress(missionPlan: MissionPlan) -> Observable<ProgressData>
-
Cancel an ongoing mission upload.
Declaration
Swift
public func cancelMissionUpload() -> Completable
-
Download a list of mission items from the system (asynchronous).
Will fail if any of the downloaded mission items are not supported by the MAVSDK API.
Declaration
Swift
public func downloadMission() -> Single<MissionPlan>
-
Download a list of mission items from the system (asynchronous) and report progress.
Will fail if any of the downloaded mission items are not supported by the MAVSDK API.
Declaration
Swift
public func downloadMissionWithProgress() -> Observable<ProgressDataOrMission>
-
Cancel an ongoing mission download.
Declaration
Swift
public func cancelMissionDownload() -> Completable
-
Start the mission.
A mission must be uploaded to the vehicle before this can be called.
Declaration
Swift
public func startMission() -> Completable
-
Pause the mission.
Pausing the mission puts the vehicle into HOLD mode. A multicopter should just hover at the spot while a fixedwing vehicle should loiter around the location where it paused.
Declaration
Swift
public func pauseMission() -> Completable
-
Clear the mission saved on the vehicle.
Declaration
Swift
public func clearMission() -> Completable
-
Sets the mission item index to go to.
By setting the current index to 0, the mission is restarted from the beginning. If it is set to a specific index of a mission item, the mission will be set to this item.
Note that this is not necessarily true for general missions using MAVLink if loop counters are used.
Declaration
Swift
public func setCurrentMissionItem(index: Int32) -> Completable
Parameters
index
Index of the mission item to be set as the next one (0-based)
-
Check if the mission has been finished.
Declaration
Swift
public func isMissionFinished() -> Single<Bool>
-
Subscribe to mission progress updates.
Declaration
Swift
public lazy var missionProgress: Observable<MissionProgress> { get set }
-
Get whether to trigger Return-to-Launch (RTL) after mission is complete.
Before getting this option, it needs to be set, or a mission needs to be downloaded.
Declaration
Swift
public func getReturnToLaunchAfterMission() -> Single<Bool>
-
Set whether to trigger Return-to-Launch (RTL) after the mission is complete.
This will only take effect for the next mission upload, meaning that the mission may have to be uploaded again.
Declaration
Swift
public func setReturnToLaunchAfterMission(enable: Bool) -> Completable
Parameters
enable
If true, trigger an RTL at the end of the mission