我正在開發一款使用Android Studio的應用程序,它以特定模式駕駛DJI Phantom 3無人機,以特定方式拍照。我將DJI示例代碼上傳到Android Studio,在Android Manifest.xml文件中輸入了一個應用程序密鑰,並修改了「MissionManager」目錄中的「CustomMissionView」代碼,以便將無人機編程爲以指定模式飛行。然而,當我在DJI模擬器上運行這個項目時,自定義任務的每個「步驟」之間會有一段時間的延遲,有時候無人機處於空閒狀態,並且沒有做任何事情就徘徊幾秒鐘。我想知道是否有任何方法可以在不設定飛行速度的情況下最大限度地縮短海關任務之間的延遲時間。我懷疑它與DJICommonCallbacks.DJICompletionCallback()
有關,但我不確定。我是Android Studio的新手,所以任何建議都會有所幫助。DJI Phantom 3自定義任務應用程序,任務步驟之間的延遲:
下面是一些「CustomMissionView」的Java文件
LinkedList<DJIMissionStep> steps = new LinkedList<DJIMissionStep>();
//Step 1: takeoff from the ground
steps.add(new DJITakeoffStep(new DJICommonCallbacks.DJICompletionCallback() {
public void onResult(DJIError error) {
Utils.setResultToToast(mContext, "Takeoff step: " + (error == null ? "Success" : error.getDescription()));
}
}));
//Step 2: reset the gimbal to desired angle
steps.add(new DJIGimbalAttitudeStep(
DJIGimbalRotateAngleMode.AbsoluteAngle,
new DJIGimbalAngleRotation(true, -30f, DJIGimbalRotateDirection.Clockwise),
null,
null,
new DJICommonCallbacks.DJICompletionCallback() {
public void onResult(DJIError error) {
Utils.setResultToToast(mContext, "Set gimbal attitude step: " + (error == null ? "Success" : error.getDescription()));
}
}));
//Step 3: Go 3 meters from home point
steps.add(new DJIGoToStep(mHomeLatitude, mHomeLongitude, 3, new DJICommonCallbacks.DJICompletionCallback() {
public void onResult(DJIError error) {
Utils.setResultToToast(mContext, "Goto step: " + (error == null ? "Success" : error.getDescription()));
}
}));