DronecodeSDK client for Swift.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sources Expose error classes so that they can be handled by clients Feb 8, 2019
proto @ 222023e Update protos Feb 8, 2019
templates Expose error classes so that they can be handled by clients Feb 8, 2019
tools Add scheme for Carthage support Feb 8, 2019
.gitmodules Add script to generate sources from the proto files Aug 22, 2018
.travis.yml Fix documentation script. Note that we lose the documentation for now… Feb 8, 2019
CONTRIBUTING.md Added CONTRIBUTING.md and link it in README.md Sep 3, 2018
Cartfile Update backend dependency Feb 8, 2019
Cartfile.resolved Update backend dependency Feb 8, 2019
LICENSE.md license: add file LICENSE.md and link to podspec May 17, 2018
Package.swift Add support for SwiftPM Feb 8, 2019
Podfile reorganize repo Aug 14, 2018
README.md Update README Feb 8, 2019
project.yml Add test targets to main scheme Feb 8, 2019



Getting started in iOS


Add the following to your Cartfile:

github "Dronecode/DronecodeSDK-Swift" ~> 0.3.0

And then get the framework using:

carthage bootstrap --platform ios

Start MAVLink connection

The steps below assume that your iOS device has a network connection to the drone, e.g. using WiFi.

By default, the SDK will connect using MAVLink on UDP port 14540, which is running by default when PX4 is run in SITL (software in the loop simulation). For now, the backend is limited to UDP even though the core supports UDP, TCP, and serial.

import Dronecode_SDK_Swift

let drone = Drone()

After that, you can start writing some code as described below.

For advanced users: note that startMavlink will run the SDK backend in a background thread on the iOS device. You could connect the SDK to another backend (say, running on a computer with IP by omitting the second line above and running only: let drone = Drone(address: "", port: 50051).

Start writing code

After that, you can start using the SDK, for instance:



     .do(onNext: { next in print(next) })

Learn more about RxSwift here, and have a look at our examples.


Check out the examples for more examples using this framework.


If you want to contribute, please check out: CONTRIBUTING.md.

Build the SDK

Most of the SDK is auto-generated from the proto files (see in proto/protos). Note that they come from a submodule (i.e. you may need to $ git submodule update --init --recursive).

To generate the source code, run:

bash tools/generate_from_protos.bash

After that, you can either build the code with SwiftPM using:

swift build

Or generate an iOS Xcode project with:


This will create the Dronecode-SDK-Swift.xcodeproj project file from project.yml. If you don't have it already, install Xcodegen with:

brew install xcodegen