dji错误:执行无法执行

时间:2017-08-11 20:29:42

标签: dji-sdk

我一直在努力安静,以便能够理解为什么我在尝试创建航点任务时由任务经理收到错误“执行无法执行”。我已经附上了我正在使用的工作流程,如果你能看一下,我真的很感激。

1.Initialize FlightController : 
mFlightController = ((Aircraft) product).getFlightController();
    getProductInstance().getGimbal()
                    .rotate(new Rotation.Builder().pitch(-180)
                            .mode(RotationMode.SPEED)
                            .yaw(Rotation.NO_ROTATION)
                            .roll(Rotation.NO_ROTATION)
                            .time(0)
                            .build(), new CommonCallbacks.CompletionCallback() {
                                @Override
                                public void onResult(DJIError error) {
                                }
                    });
mFlightController.setControlMode(ControlMode.SMART, ... );
mFlightController.setMaxFlightHeight(499.0f , ... );
mFlightController.setMaxFlightRadiusLimitationEnabled(false, ...);
mFlightController.setLandImmediatelyBatteryThreshold(15, ...);
mFlightController.setStateCallback(new FlightControllerState.Callback() {
            @Override
            public void onUpdate(@NonNull FlightControllerState flightControllerState) {
        //Check GPS level
    }
}
mFlightController.setHomeLocationUsingAircraftCurrentLocation( ... );



  2. Check Batter status :
getProductInstance().getBattery()
            setStateCallback(new BatteryState.Callback() {
                    @Override
                    public void onUpdate(BatteryState djiBatteryState) { ... } ;
    });

    3. initialize Mission Manager : 
mMissionManager = new WapointMissionOperator();
mMissionManager.addListener( listener );
    //LIstener does a couple calculations when reaching a waypoint. 

 4. Camera :
mCamera = getProductInstance().getCamera();
mCamera.setMode(SettingsDefinitions.CameraMode.RECORD_VIDEO, ... );
mCamera.setSystemStateCallback(new SystemState.Callback() { ... });


 5. Creating waypoint mission Builder : 
WaypointMission.Builder builder = new WaypointMission.Builder();
builder.autoFlightSpeed( value );
builder.maxFlightSpeed( value );
builder.setExitMissionOnRCSignalLostEnabled(false);
    builder.finishedAction(WaypointMissionFinishedAction.AUTO_LAND);
    builder.flightPathMode(WaypointMissionFlightPathMode.NORMAL);
    builder.gotoFirstWaypointMode(WaypointMissionGotoWaypointMode.SAFELY);
    builder.headingMode(WaypointMissionHeadingMode.USING_WAYPOINT_HEADING);
    builder.setGimbalPitchRotationEnabled(true);

 6. Creating waypoints : 
    for (int i = 0; i < waypointCount; i++) {
        dji.common.mission.waypoint.Waypoint djiwp = new dji.common.mission.waypoint.Waypoint(lat, lon, alt);
        djiwp.heading = 0; //facing true north
        djiwp.addAction(new WaypointAction(WaypointActionType.STAY, 0)); //just passby 
        builder.addWaypoint(djiwp);
    }

  7. finishing up with builder:
WaypointMission mission = builder.build();

 8. starting mission :
mMissionManager.loadMission(mission);
if (WaypointMissionState.READY_TO_RETRY_UPLOAD.equals(mMissionManager.getCurrentState())
                              ||   WaypointMissionState.READY_TO_UPLOAD.equals(mMissionManager.getCurrentState())) {

    mMissionManager.uploadMission(new CommonCallbacks.CompletionCallback() { ... } );
}
mFlightController.setHomeLocationUsingAircraftCurrentLocation( ... ); //redo just to check.
mFlightController.setConnectionFailSafeBehavior(ConnectionFailSafeBehavior.GO_HOME, ...);
mMissionManager.startMission(new CommonCallbacks.CompletionCallback() { ... });

2 个答案:

答案 0 :(得分:1)

确保在尝试执行之前准备好执行。在我这样做之前,我遇到了很多失败。

答案 1 :(得分:1)

使用MissionManager,我假设您使用的是DJI SDK的3.x版本。 你应该试试4.x版本。最新的一个是4.3.2。 任务相关功能现在已经改进并且更加稳定。 现在的联系点是MissionControl而不是MissionManager。 查看API参考页面。它也经过了改进: http://developer.dji.com/api-reference/android-api/Components/Missions/DJIMissionControl.html