I was trying to recreate your NavigationExecutor.java but needed a different flight path. I'm trying to get the drone to move forward, but it doesn't move and was wondering if maybe I'm doing something wrong?
// Set Virtual Sticks in case they wasn't before
flightController.setVirtualStickModeEnabled(true, null);
flightController.setVirtualStickAdvancedModeEnabled(true);
//Set modes for flight controller
flightController.setVerticalControlMode(VerticalControlMode.VELOCITY);
flightController.setYawControlMode(YawControlMode.ANGULAR_VELOCITY);
flightController.setRollPitchControlMode(RollPitchControlMode.VELOCITY);
flightController.setRollPitchCoordinateSystem(FlightCoordinateSystem.BODY);
// Turn on Vision Assisted if it was OFF
flightAssistant.getVisionAssistedPositioningEnabled(new CommonCallbacks.CompletionCallbackWith<Boolean>() {
@Override
public void onSuccess(Boolean aBoolean) {
if (!aBoolean) {
flightAssistant.setVisionAssistedPositioningEnabled(true, null);
}
}
@Override
public void onFailure(DJIError djiError) {
}
});
// Turn off Collision avoidance if it was ON
flightAssistant.getCollisionAvoidanceEnabled(new CommonCallbacks.CompletionCallbackWith<Boolean>() {
@Override
public void onSuccess(Boolean aBoolean) {
if (aBoolean) {
flightAssistant.setCollisionAvoidanceEnabled(false, null);
}
}
@Override
public void onFailure(DJIError djiError) {
}
});
and then in my case statement I run this:
flightController.sendVirtualStickFlightControlData(new FlightControlData(1f, 0, 0, 0), null);
The drone takes off, hovers, and then lands when it should be moving forward; any thoughts?
Thanks in advance and cheers!
Android Studio: 3.3.0.0
Android: 8.0.1
Drone: Mavic Air
Hello!
I was trying to recreate your NavigationExecutor.java but needed a different flight path. I'm trying to get the drone to move forward, but it doesn't move and was wondering if maybe I'm doing something wrong?
So I declare the variables on the class level:
and then in my function, I declare:
and then in my case statement I run this:
flightController.sendVirtualStickFlightControlData(new FlightControlData(1f, 0, 0, 0), null);
The drone takes off, hovers, and then lands when it should be moving forward; any thoughts?
Thanks in advance and cheers!
Android Studio: 3.3.0.0 Android: 8.0.1 Drone: Mavic Air