Drone#
Code samples in the camera section refer to a Drone object.
Here is the sample code to initialize this Drone object:
/** Current drone instance. */
private var drone: Drone? = null
override fun onStart() {
super.onStart()
// Monitor the auto connection facility.
groundSdk.getFacility(AutoConnection::class.java) {
// Called when the auto connection facility is available and when it changes.
it?.let {
// Start auto connection.
if (it.status != AutoConnection.Status.STARTED) {
it.start()
}
drone = it.drone
}
}
}
A complete implementation of the camera is also available in GroundSdkDemo here.