Comments

13 comments

  • DJI Developer Support
    你是在哪个函数上报出的这个错误呢?这个错误关联的场景有很多。例如无人机正在执行其他任务、航线的配置不完整。
    0
    Comment actions Permalink
  • 陈宁
    startMission 这个函数报错

    msdk版本
    compileOnly 'com.dji:dji-sdk-provided:4.16'
    implementation 'com.dji:dji-uxsdk:4.14'

    M300 固件。04.00.0200

    进过测试御2双光可以正常执行 m300 不行




    private void configWayPointMission() {
    List<Waypoint> waypointList = new ArrayList<>();
    for (XML2JSON.KmlDTO.DocumentDTO.FolderDTO.PlacemarkDTO placemarkDTO : xmlToJson.getKml().getDocument().getFolder().getPlacemark()) {
    if(placemarkDTO.getPoint().getAltitudeMode().equals("absolute")){
    lineMode=true;
    }else {
    lineMode=false;
    }
    String str[]=placemarkDTO.getPoint().getCoordinates().split(",");
    Waypoint latLng;
    if(lineMode){
    latLng = new Waypoint(Float.parseFloat(str[1]), Float.parseFloat(str[0]),Float.parseFloat(str[2])-FlySingle.getInstance().ele);
    NariCrashHandler.WriteFile(Float.parseFloat(str[1])+":"+Float.parseFloat(str[0])+":"+(Float.parseFloat(str[2])-FlySingle.getInstance().ele));

    }else {
    latLng = new Waypoint(Float.parseFloat(str[1]), Float.parseFloat(str[0]),Float.parseFloat(str[2]));
    NariCrashHandler.WriteFile(Float.parseFloat(str[1])+":"+Float.parseFloat(str[0])+":"+Float.parseFloat(str[2]));

    }
    if(placemarkDTO.getExtendedData().getActions()!=null){
    for (XML2JSON.KmlDTO.DocumentDTO.FolderDTO.PlacemarkDTO.ExtendedDataDTO.ActionsDTO action : placemarkDTO.getExtendedData().getActions()) {
    WaypointAction waypointAction= null;
    switch (action.getContent()){
    case "AircraftYaw":
    waypointAction= new WaypointAction(WaypointActionType.ROTATE_AIRCRAFT,Integer.parseInt(action.getParam()));
    break;
    case "GimbalPitch":
    waypointAction= new WaypointAction(WaypointActionType.GIMBAL_PITCH,Integer.parseInt(action.getParam()));
    break;
    case "ShootPhoto":
    waypointAction= new WaypointAction(WaypointActionType.START_TAKE_PHOTO,Integer.parseInt(action.getTargetMode()));
    break;

    }
    latLng.addAction(waypointAction);
    }

    }
    waypointList.add(latLng);
    }

    WaypointMission.Builder waypointMissionBuilder = new WaypointMission.Builder();
    waypointMissionBuilder.finishedAction(WaypointMissionFinishedAction.GO_HOME)
    .headingMode(WaypointMissionHeadingMode.AUTO)
    .autoFlightSpeed(Float.parseFloat(xmlToJson.getKml().getDocument().getPlacemark().getExtendedData().getAutoFlightSpeed()))
    .maxFlightSpeed(Float.parseFloat(xmlToJson.getKml().getDocument().getPlacemark().getExtendedData().getAutoFlightSpeed()))
    .flightPathMode(WaypointMissionFlightPathMode.NORMAL);
    waypointMissionBuilder.waypointList(waypointList).waypointCount(waypointList.size());
    final WaypointMissionOperator missionOperator = MainApplication.getWaypointMissionOperator();
    if (null != missionOperator) {
    DJIError error = missionOperator.loadMission(waypointMissionBuilder.build());
    if (error == null) {
    MainApplication.showToast("任务配置成功");

    } else {
    MainApplication.showToast("任务配置失败:" + error.getDescription());
    }
    }
    if (null != missionOperator) {
    missionOperator.uploadMission(new CommonCallbacks.CompletionCallback() {
    @Override
    public void onResult(DJIError error) {
    if (error == null) {
    runOnUiThread(new Runnable() {
    @Override
    public void run() {
    startWaypointMission();
    MainApplication.showToast("任务上传成功");
    }
    });
    } else {
    String s = "任务上传失败,请重试: " + error.getDescription();
    MainApplication.showToast(s);
    }
    }
    });
    }
    }

    private void startWaypointMission() {
    WaypointMissionOperator missionOperator = MainApplication.getWaypointMissionOperator();
    if (null != missionOperator) {
    missionOperator.startMission(error -> {

    if (error == null) {
    MainApplication.GimbalModule.setRotate(-90, djiError -> {

    });
    } else {

    MainApplication.showToast(error.getDescription());
    }
    });
    }
    }
    0
    Comment actions Permalink
  • DJI Developer Support
    M300并没有特别去适配V1航线,存在一些问题,因此我们并不推荐开发者使用V1+M300. 您可以尝试一下V2航线,这里是我们的示例代码:Mobile-SDK-Android/WaypointV2MissionOperatorView.java at master · dji-sdk/Mobile-SDK-Android (github.com)
    0
    Comment actions Permalink
  • 陈宁

    尝试了V2还是同样问题,试了几款小飞机没有问题,就是M300到执行这一步不行

     

     

    0
    Comment actions Permalink
  • DJI Developer Support
    您使用我们的sample的waypointV2航线在模拟器也是无法执行航线吗?pilot可以正常执行航线吗?
    0
    Comment actions Permalink
  • 陈宁

    pilot 可以 msdk就不行

    0
    Comment actions Permalink
  • DJI Developer Support
    你可以上传一个你使用我们sample的视频给我们吗?如果上传航线失败或者当前状态不是ready_to_execute也是会开始失败。 链接:https://pan-sec.djicorp.com/s/tDHNTgCxX3DAm4j 密码:dji123
    0
    Comment actions Permalink
  • 闫善书

    我也遇到了,有结果吗?上传航线的时候提示这个

    0
    Comment actions Permalink
  • DJI Developer Support
    上传航线的时候提示command cannot executed。有检查航线的设置完整吗?是否有超过无人机的限高限远呢?
    0
    Comment actions Permalink
  • 陈宁

    完整,利用其他型号无人机试飞没问题

     

    0
    Comment actions Permalink
  • DJI Developer Support
    您可以录制一个使用sample复现问题的视频给我们吗?或者将您遇到问题的航点任务代码分享给我们。这样我们可以更加详细地了解到你的问题。 LINK:https://pan-sec.djicorp.com/s/tDHNTgCxX3DAm4j password:dji123
    0
    Comment actions Permalink
  • lvheng

    我们现在也遇到这个问题,请问下怎么解决的?

    0
    Comment actions Permalink
  • 791867737

    我现在也遇到这个问题了,请问解决了吗?

     

    0
    Comment actions Permalink

Please sign in to leave a comment.