-
-
Notifications
You must be signed in to change notification settings - Fork 569
Description
Using mavsdk-2.1.0 and mavsdk-server-2.1.5 and Ardupilot SITL as the backend on an IP port I cannot get telemetry data on Android. Keeps telling me its retrying when I subscribe for position data. The only code I'm using beside server.run() and new System() is this in my main activity.kt :
fun runServer() {
MavsdkEventQueue.executor().execute({
val address = "tcp://192.168.29.118:5763"
val port = server.run(address)
Log.d(TAG, "port is $port")
if(port == 0) {
Log.e(TAG,"Unable to start server")
return@execute
}
drone = System("127.0.0.1",port)
isRunning = true
buttonText= "Destroy"
Log.i(TAG,"Server started")
setupSubscriptions()
})
}
@SuppressLint("CheckResult")
fun setupSubscriptions() {
val altitude = drone.telemetry.position.subscribeOn(Schedulers.io())
.observeOn(Schedulers.single())
.subscribe({
Log.d(TAG,"info : $it")
Log.d(TAG,"Lat = " + it.latitudeDeg + ", Lon= " + it.longitudeDeg)
latText = " " + it.latitudeDeg
longText = " " + it.longitudeDeg
}, Throwable::printStackTrace)
}
I've validated that QGC and mavproxy are able to both communicate with the SITL. When I change the mavsdk and server versions to 2.0 , then this works perfectly.