1
我試圖使用SDK 3.0.1,但沒有成功,我的旋轉幻影3我不能讓我的旋轉幻影3 DJI SDK 3.01
我的代碼:
DJIFlightController flightController = ((DJIAircraft) mProduct).getFlightController();
flightController.enableVirtualStickControlMode(new DJICompletionCallback() {
@Override
public void onResult(DJIError error) {
if (error == null) {
showToast("enableVirtualStickControlMode: success");
} else {
showToast(error.getDescription());
}
}
});
try {
sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
showToast("Set yaw control mode to angle");
flightController.setHorizontalCoordinateSystem(DJIFlightControllerDataType.DJIVirtualStickFlightCoordinateSystem.Body);
flightController.setRollPitchControlMode(DJIFlightControllerDataType.DJIVirtualStickRollPitchControlMode.Angle);
flightController.setVerticalControlMode(DJIFlightControllerDataType.DJIVirtualStickVerticalControlMode.Velocity);
flightController.setYawControlMode(DJIFlightControllerDataType.DJIVirtualStickYawControlMode.Angle);
try {
sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
DJIFlightControllerDataType.DJIVirtualStickFlightControlData flightControlData =
new DJIFlightControllerDataType.DJIVirtualStickFlightControlData(0, 0, 45, 0);
flightController.sendVirtualStickFlightControlData(flightControlData, new DJICompletionCallback() {
@Override
public void onResult(DJIError error) {
if (error == null) {
showToast("Rotation: success");
} else {
showToast(error.getDescription());
}
}
});
try {
sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
flightController.disableVirtualStickControlMode(new DJICompletionCallback() {
@Override
public void onResult(DJIError error) {
if (error == null) {
showToast("disableVirtualStickControlMode: success");
} else {
showToast(error.getDescription());
}
}
});
我得到消息「旋轉:成功」,但飛機不動。 我做錯了什麼? 我真的很感激任何幫助。