These are chat archives for dronekit/dronekit-android

15th
Mar 2016
Cee Jay
@ChrisJLester
Mar 15 2016 13:55

Hello, I am having a bit of trouble getting turnTo() to work in the ControlAPI, I keep getting the Command failed execution error. This is the code I am trying to use, trying to make the drone point east.
'''
ControlApi.getApi(this.drone).turnTo(90, 30, false, new AbstractCommandListener() {
@Override
public void onSuccess() {
makeToast("Success");
}
@Override
public void onError(int executionError) {
read_executionError("Failed to rotate", executionError);
}
@Override
public void onTimeout() {
makeToast("Failed to rotate (timeout)");
}

        });

'''

chaviw
@chaviw
Mar 15 2016 15:51
@hsteinhaus You shouldn’t need to need to create your own aar file from dronekit-androidunless you are planning on modifying dronekit-android. You should instead use the latest from binary which will always contain the latest stable version. In your build.gradle file you should add compile com.o3dr.android:dronekit-android:2.8.1 and modify 2.8.1 with latest version found here
https://bintray.com/3drobotics/maven/dronekit-android/view
@ChrisJLester Are you enabling manual control before executing that command? That is required in order to execute any control api calls. https://github.com/dronekit/dronekit-android/blob/develop/ClientLib/src/main/java/com/o3dr/android/client/apis/ControlApi.java#L164
Cee Jay
@ChrisJLester
Mar 15 2016 17:09
I wasn't no, takeoff(), climbTo() and goTo() work fine but Ill try it tomorrow, thanks!
Holger Steinhaus
@hsteinhaus
Mar 15 2016 17:32
@chaviw I need to modify dronekit-android after adding MavLink fields. So any ideas how to get the new Mavlink classes into classpath?
chaviw
@chaviw
Mar 15 2016 17:37
@hsteinhaus If you import the root directory of dronekit-android you should get all the dependency libraries in Android Studio. You will get a Mavlink libarary that you can modify if you need to
RazaRana
@RazaRana
Mar 15 2016 18:26
@ChrisJLester 2nd argument for the method turnto must be between -1f to 1f. use ControlApi.getApi(this.drone).turnTo(90, 0.1f, false, new AbstractCommandListener()...
@chaviw i am not getting any callback from error, timeout, or success toast but on onManualControlToggled is working
Holger Steinhaus
@hsteinhaus
Mar 15 2016 19:14
@chaviw dronekit-android compiles perfectly fine (with MavLink changes). My problem is Tower not being aware of the full set of classed provided by dronekit-android. Regarding to the tutorial (https://github.com/DroidPlanner/Tower/wiki/Work-with-DroneKit-Android), adding the ClientLib/build/outputs/aar directory to Tower's build.gradle should do the trick, but it doesn't. When looking into the aar, I cannot discover any trace of the MAvLink classes. So where is the problem - in Tower or in dronekit-android?
chaviw
@chaviw
Mar 15 2016 20:08
@hsteinhaus Are you replacing the dronekit-android in the build.gradle file of Tower with your own? Basically replace compile 'com.o3dr.android:dronekit-android:2.8.0’ with compile(name:’name_of_your_local_dronekit', ext:'aar’)