MAVSDK-Java
MAVSDK-Java copied to clipboard
Having issues with uploading mission using mavsdk 2.1
I am using the maven versions of mavsdk and mavsdk server 2.1 along with mavsdk event queue to upload a mission like this
MavsdkEventQueue.executor().execute(() -> {
try {
Completable res = drone.getMissionRaw().clearMission()
.doOnComplete(() -> Log.d(TAG, "clearMission"))
.doOnError(throwable -> Log.e(TAG, "Failed to clear Mission due to " + throwable.getMessage()))
.andThen(_blitzdrone.getMissionRaw().uploadMission(missionItems)
.doOnComplete(() -> Log.d(TAG, "Upload Mission succeeded"))
.doOnError(throwable -> Log.e(TAG, "Failed to upload the mission " + throwable.getMessage())));
_disposables.add(res
.subscribe(
() -> {
Log.d(TAG, "Mission clear and upload process completed successfully");
},
throwable -> {
Log.e(TAG,"Mission clear and upload process failed: " + throwable.getMessage());
}
));
} catch (Throwable err) {
Log.e(TAG, "Mission error " + err.getMessage());
}
});
The results I am getting are similar to what issue #166 implied. Which is strange since I thought the fix was implemented into the maven version that I referenced.
Failed to clear Mission due to TIMEOUT: Timeout
Some times the mission gets uploaded , a lot of times it does not. FWIW I am also seeing this when I try to execute actions like start mission, and pause mission . Finally I was seeing this issue on mavsdk 1.3.1 but not as much.
Am I doing something wrong in terms of writing this function?
Thanks Mike