dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
994 stars 580 forks source link

请问航线飞行老提示10010错误怎么解决? #1042

Closed addriumruss closed 3 years ago

addriumruss commented 3 years ago

设备: M300RTK + H20 MSDK: 4.14 安卓设备: M300RTK遥控器自带安卓设备 测试情况:市区大部分航线能飞行成功,但是在一个郊区江边的航线总是失败,提示10010错误码。

代码: UavData.instance.waypointMissionOperator.startMission(djiError1 -> { if(djiError1 != null){ ToastUtils.setResultToToast("航线执行失败: "+ djiError1.getDescription() +", 错误码: "+djiError1.getErrorCode()+"\n即将重新尝试."); } });

请问这是什么原因,有没有什么解决思路和办法?

dji-dev commented 3 years ago

Agent comment from DJI SDK in Zendesk ticket #55202:

尊敬的开发者,感谢您联系DJI 大疆创新 由于github不是我们主要的咨询渠道,您的问题可能跟进不及时。我们建议您通过填写表单( https://djisdksupport.zendesk.com/hc/zh-cn/requests/new )向我们反馈问题。或者您也可以在论坛发帖,与其它开发者交流。论坛链接:https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

Dear developer, thank you for contacting DJI. Since github is not our main consultation channel, your questions may not be followed up in time. We recommend that you fill in the form (https://djisdksupport.zendesk.com/hc/en-us/requests/new) to report problems to us. Or you can post in the forum to communicate with other developers. Forum link: https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

°°°

dji-dev commented 3 years ago

Agent comment from Hummels Lei in Zendesk ticket #55202:

请问您用的是航点任务V1还是V2,一般来说M300是不建议用航点任务V1的。

°°°

addriumruss commented 3 years ago

目前是用的V1版, sdk4.14 老提示10010. 刚刚把sdk改为4.15.1, 同时增加了V2支持,结果V1和V2航线飞都是直接运行出错,飞不了,提示Command cannot execute, 错误码是-1 , 不知道什么原因,现在正在升级飞机的固件,不知道能不能解决

DJI-William commented 3 years ago

首先M300肯定用不了V1,V2提示Command cannot execute应该是你的航线设置有问题。先飞一下Sample的,然后再按照Sample去制作你的V2航线。我们会调研一下为什么固件推送Command cannot execute。

addriumruss commented 3 years ago

@DJI-William @dji-dev 目前还是用的V1, V1大部分情况能用,就是有时候总是提示10010错误, 例如港口、江面场景总是提示10010错误无法启动航线飞行。 V2失败了,没飞起来,一律提示Command cannot execute, 错误码是-1,就是照抄的示例代码,具体如下: //航线生成 public WaypointV2Mission getWaypointV2MissionFromFlyRoute(FlyRoute route) { WaypointV2Mission.Builder builder = new WaypointV2Mission.Builder() .setMissionID(new Random().nextInt(65535)) .setAutoFlightSpeed(5F) .setMaxFlightSpeed(15F) .setGotoFirstWaypointMode(WaypointV2MissionTypes.MissionGotoWaypointMode.SAFELY) .setExitMissionOnRCSignalLostEnabled(false) .setRepeatTimes(1); builder.setFinishedAction(WaypointV2MissionTypes.MissionFinishedAction.GO_HOME); for (int i = 0; i < route.pts.size(); i++) { FlyPoint fp = route.pts.get(i); WaypointV2.Builder wpBuilder = new WaypointV2.Builder() .setAutoFlightSpeed(fp.spd) .setCoordinate(new LocationCoordinate2D(fp.lat, fp.lng)) .setAltitude(fp.ht) .setHeadingMode(WaypointV2MissionTypes.WaypointV2HeadingMode.AUTO); WaypointV2 eachWaypoint = wpBuilder.build(); builder.addWaypoint(eachWaypoint); } return builder.build(); } //执行起飞 final WaypointV2Mission mission = MissionService.instance.getWaypointV2MissionFromFlyRoute(route); UavData.instance.waypointV2MissionOperator.loadMission(mission, djiWaypointV2Error -> { if (djiWaypointV2Error != null) { ToastUtils.setResultToToast("航线加载失败: " + djiWaypointV2Error.getDescription() + ", 错误码: " + djiWaypointV2Error.getErrorCode()); } else { WaypointV2MissionState state = UavData.instance.waypointV2MissionOperator.getCurrentState(); if (state != WaypointV2MissionState.READY_TO_UPLOAD) { ToastUtils.setResultToToast("航线加载失败: 未准备就绪,请稍后重试"); } else { UavData.instance.waypointV2MissionOperator.uploadMission(djiWaypointV2Error2 -> { if (djiWaypointV2Error2 != null) { ToastUtils.setResultToToast("航线上传失败: " + djiWaypointV2Error2.getDescription() + ", 错误码: " + djiWaypointV2Error2.getErrorCode()); }else{ UavData.instance.waypointV2MissionOperator.startMission(djiWaypointV2Error3 -> { if (djiWaypointV2Error3 != null) { // =======>>> 这里总是弹出10010错误!!! ToastUtils.setResultToToast("航线执行失败: " + djiWaypointV2Error3.getDescription()

DJI-William commented 3 years ago

@addriumruss 你这个startMission是在uploadMission的回调里执行的,这个是不对的,这个意思是回调这个函数的调用是否成功,不代表upload是否完成。你要监听upload是否完成。这个要在waypointV2MissionOperatorListener中监听onUploadUpdate,保证

if (waypointV2MissionUploadEvent.getPreviousState() == WaypointV2MissionState.UPLOADING && waypointV2MissionUploadEvent.getCurrentState() == WaypointV2MissionState.READY_TO_EXECUTE) { ToastUtils.setResultToToast("Mission is uploaded successfully"); } 才能调用Start。

addriumruss commented 3 years ago

@DJI-William 感谢提醒! 我马上试下。

addriumruss commented 3 years ago

@DJI-William 按照您的提示,调整后飞行成功了,非常感谢!

addriumruss commented 3 years ago

最后更新msdk到4.15.1, 更新飞机固件到最新版本,同时改为采用V2模式飞行,最后10010问题没有再出现,非常感谢!