command cannot executed 执行航线提示错误 什么原因导致的
Completedcommand cannot executed 执行航线提示错误 什么原因导致的
-
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());
}
});
}
} -
你可以上传一个你使用我们sample的视频给我们吗?如果上传航线失败或者当前状态不是ready_to_execute也是会开始失败。 链接:https://pan-sec.djicorp.com/s/tDHNTgCxX3DAm4j 密码:dji123 -
您可以录制一个使用sample复现问题的视频给我们吗?或者将您遇到问题的航点任务代码分享给我们。这样我们可以更加详细地了解到你的问题。 LINK:https://pan-sec.djicorp.com/s/tDHNTgCxX3DAm4j password:dji123
Please sign in to leave a comment.
Comments
13 comments