|
|
|
@ -739,6 +739,10 @@ const saveAirLine = ()=>{
|
|
|
|
|
let templateXml = templateXmlStrTemp.replace("<kml>",`<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:wpml="http://www.dji.com/wpmz/1.0.6">`)
|
|
|
|
|
|
|
|
|
|
// 带wpml前缀的 wayline json数据
|
|
|
|
|
// delete props.waylineWpmlConfig.missionConfig.takeOffRefPoint
|
|
|
|
|
// delete props.waylineWpmlConfig.missionConfig.takeOffRefPointAGLHeight
|
|
|
|
|
// delete props.waylineWpmlConfig.missionConfig.autoRerouteInfo
|
|
|
|
|
|
|
|
|
|
let waylineJosn = {kml:{Document:props.waylineWpmlConfig}}
|
|
|
|
|
let waylienWpmlJson = handlerPrefixWpml(waylineJosn);
|
|
|
|
|
let waylineXmlStr = builder.build(waylienWpmlJson);
|
|
|
|
@ -801,6 +805,8 @@ const handlerPrefixWpml = (obj) => {
|
|
|
|
|
// 生成xml文件,创建航线
|
|
|
|
|
const handlerCreateFile =async (templateXml,waylineXml)=>{
|
|
|
|
|
|
|
|
|
|
console.log("waylineXml",waylineXml);
|
|
|
|
|
// return null;
|
|
|
|
|
const blob =await convertXmlToKmz(templateXml,waylineXml);
|
|
|
|
|
|
|
|
|
|
// 创建FormData对象用于上传
|
|
|
|
@ -1015,8 +1021,10 @@ const handlerWaylineWpml = () => {
|
|
|
|
|
|
|
|
|
|
// 航线计算数据处理
|
|
|
|
|
const handlerStatistics = () => {
|
|
|
|
|
props.waylineWpmlConfig.Folder.distance = props.airInfo.length;
|
|
|
|
|
props.waylineWpmlConfig.Folder.duration = props.airInfo.time;
|
|
|
|
|
props.waylineWpmlConfig.Folder.distance = props.airInfo.length*1000;
|
|
|
|
|
props.waylineWpmlConfig.Folder.duration = props.airInfo.time*60*2;
|
|
|
|
|
props.waylineWpmlConfig.Folder.executeHeightMode = "relativeToStartPoint"
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理航线数据
|
|
|
|
@ -1030,21 +1038,21 @@ const handelrAirPoint = () => {
|
|
|
|
|
let height = 0;
|
|
|
|
|
|
|
|
|
|
// 计算间隔时间
|
|
|
|
|
let spaceTime = (calculateInterval(calculatParam.value.gsd,calculatParam.value.overlapX/100,uavModel['m4td']) / props.templateKmlConfig.Folder.autoFlightSpeed)
|
|
|
|
|
let spaceTime = (calculateInterval(calculatParam.value.gsd,calculatParam.value.overlapX/100,uavModel['m4td']) / props.templateKmlConfig.Folder.autoFlightSpeed) * 2
|
|
|
|
|
|
|
|
|
|
// 起飞点高度
|
|
|
|
|
let heightArr = props.waylineWpmlConfig.missionConfig.takeOffRefPoint.split(",");
|
|
|
|
|
let heightArr = props.templateKmlConfig.missionConfig.takeOffRefPoint.split(",");
|
|
|
|
|
|
|
|
|
|
height = heightArr[2]
|
|
|
|
|
|
|
|
|
|
console.log("起飞点高度",height);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理第1个航点
|
|
|
|
|
if(index == 0){
|
|
|
|
|
point = {
|
|
|
|
|
"Point": {
|
|
|
|
|
"coordinates":item.lng+","+item.lat
|
|
|
|
|
"coordinates":"\n"+item.lng+","+item.lat+"\n"
|
|
|
|
|
},
|
|
|
|
|
"index": item.id,
|
|
|
|
|
"executeHeight": item.alt - height,
|
|
|
|
@ -1143,7 +1151,7 @@ const handelrAirPoint = () => {
|
|
|
|
|
}else if(index == props.airPoints.length -1){ // 处理最后1个航点
|
|
|
|
|
point = {
|
|
|
|
|
"Point": {
|
|
|
|
|
"coordinates":item.lng+","+item.lat
|
|
|
|
|
"coordinates":"\n"+item.lng+","+item.lat +"\n"
|
|
|
|
|
},
|
|
|
|
|
"index": item.id,
|
|
|
|
|
"executeHeight": item.alt - height,
|
|
|
|
@ -1192,9 +1200,143 @@ const handelrAirPoint = () => {
|
|
|
|
|
"waypointWorkType": 0
|
|
|
|
|
}
|
|
|
|
|
}else if(index == props.airPoints.length -2){ // 处理倒数第2个航点
|
|
|
|
|
|
|
|
|
|
point = {
|
|
|
|
|
"Point": {
|
|
|
|
|
"coordinates":"\n"+ (item.lng+0.00001)+","+(item.lat+0.00001)+"\n"
|
|
|
|
|
},
|
|
|
|
|
"index": item.id,
|
|
|
|
|
"executeHeight": item.alt - height,
|
|
|
|
|
"waypointSpeed": props.templateKmlConfig.Folder.autoFlightSpeed,
|
|
|
|
|
"waypointHeadingParam": {
|
|
|
|
|
"waypointHeadingMode": "followWayline",
|
|
|
|
|
"waypointHeadingAngle": -120.875268753987,
|
|
|
|
|
"waypointPoiPoint": "0.000000,0.000000,0.000000",
|
|
|
|
|
"waypointHeadingAngleEnable": 1,
|
|
|
|
|
"waypointHeadingPathMode": "followBadArc",
|
|
|
|
|
"waypointHeadingPoiIndex": 0
|
|
|
|
|
},
|
|
|
|
|
"waypointTurnParam": {
|
|
|
|
|
"waypointTurnMode": "toPointAndStopWithDiscontinuityCurvature",
|
|
|
|
|
"waypointTurnDampingDist": 0
|
|
|
|
|
},
|
|
|
|
|
"useStraightLine": 1,
|
|
|
|
|
"actionGroup": [
|
|
|
|
|
{
|
|
|
|
|
"actionGroupId": 3,
|
|
|
|
|
"actionGroupStartIndex": item.id,
|
|
|
|
|
"actionGroupEndIndex": item.id,
|
|
|
|
|
"actionGroupMode": "sequence",
|
|
|
|
|
"actionTrigger": {
|
|
|
|
|
"actionTriggerType": "reachPoint"
|
|
|
|
|
},
|
|
|
|
|
"action": [
|
|
|
|
|
{
|
|
|
|
|
"actionId": 0,
|
|
|
|
|
"actionActuatorFunc": "gimbalRotate",
|
|
|
|
|
"actionActuatorFuncParam": {
|
|
|
|
|
"gimbalHeadingYawBase": "aircraft",
|
|
|
|
|
"gimbalRotateMode": "absoluteAngle",
|
|
|
|
|
"gimbalPitchRotateEnable": 1,
|
|
|
|
|
"gimbalPitchRotateAngle": -45,
|
|
|
|
|
"gimbalRollRotateEnable": 0,
|
|
|
|
|
"gimbalRollRotateAngle": 0,
|
|
|
|
|
"gimbalYawRotateEnable": 1,
|
|
|
|
|
"gimbalYawRotateAngle": 0,
|
|
|
|
|
"gimbalRotateTimeEnable": 0,
|
|
|
|
|
"gimbalRotateTime": 10,
|
|
|
|
|
"payloadPositionIndex": 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"actionId": 1,
|
|
|
|
|
"actionActuatorFunc": "hover",
|
|
|
|
|
"actionActuatorFuncParam": {
|
|
|
|
|
"hoverTime": 0.5
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"actionGroupId": 4,
|
|
|
|
|
"actionGroupStartIndex": item.id,
|
|
|
|
|
"actionGroupEndIndex": item.id+1,
|
|
|
|
|
"actionGroupMode": "sequence",
|
|
|
|
|
"actionTrigger": {
|
|
|
|
|
"actionTriggerType": "multipleTiming",
|
|
|
|
|
"actionTriggerParam": 2
|
|
|
|
|
},
|
|
|
|
|
"action": {
|
|
|
|
|
"actionId": 0,
|
|
|
|
|
"actionActuatorFunc": "gimbalRotate",
|
|
|
|
|
"actionActuatorFuncParam": {
|
|
|
|
|
"gimbalHeadingYawBase": "aircraft",
|
|
|
|
|
"gimbalRotateMode": "absoluteAngle",
|
|
|
|
|
"gimbalPitchRotateEnable": 1,
|
|
|
|
|
"gimbalPitchRotateAngle": -45,
|
|
|
|
|
"gimbalRollRotateEnable": 0,
|
|
|
|
|
"gimbalRollRotateAngle": 0,
|
|
|
|
|
"gimbalYawRotateEnable": 0,
|
|
|
|
|
"gimbalYawRotateAngle": 0,
|
|
|
|
|
"gimbalRotateTimeEnable": 0,
|
|
|
|
|
"gimbalRotateTime": 10,
|
|
|
|
|
"payloadPositionIndex": 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"actionGroupId": 5,
|
|
|
|
|
"actionGroupStartIndex": item.id,
|
|
|
|
|
"actionGroupEndIndex": item.id+1,
|
|
|
|
|
"actionGroupMode": "sequence",
|
|
|
|
|
"actionTrigger": {
|
|
|
|
|
"actionTriggerType": "betweenAdjacentPoints"
|
|
|
|
|
},
|
|
|
|
|
"action": [
|
|
|
|
|
{
|
|
|
|
|
"actionId": 0,
|
|
|
|
|
"actionActuatorFunc": "gimbalAngleLock"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"actionId": 1,
|
|
|
|
|
"actionActuatorFunc": "gimbalRotate",
|
|
|
|
|
"actionActuatorFuncParam": {
|
|
|
|
|
"gimbalHeadingYawBase": "aircraft",
|
|
|
|
|
"gimbalRotateMode": "absoluteAngle",
|
|
|
|
|
"gimbalPitchRotateEnable": 1,
|
|
|
|
|
"gimbalPitchRotateAngle": -45,
|
|
|
|
|
"gimbalRollRotateEnable": 0,
|
|
|
|
|
"gimbalRollRotateAngle": 0,
|
|
|
|
|
"gimbalYawRotateEnable": 0,
|
|
|
|
|
"gimbalYawRotateAngle": 0,
|
|
|
|
|
"gimbalRotateTimeEnable": 0,
|
|
|
|
|
"gimbalRotateTime": 10,
|
|
|
|
|
"payloadPositionIndex": 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"actionId": 2,
|
|
|
|
|
"actionActuatorFunc": "startTimeLapse",
|
|
|
|
|
"actionActuatorFuncParam": {
|
|
|
|
|
"payloadPositionIndex": 0,
|
|
|
|
|
"useGlobalPayloadLensIndex": 0,
|
|
|
|
|
"payloadLensIndex": "visable",
|
|
|
|
|
"minShootInterval": spaceTime
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"waypointGimbalHeadingParam": {
|
|
|
|
|
"waypointGimbalPitchAngle": 0,
|
|
|
|
|
"waypointGimbalYawAngle": 0
|
|
|
|
|
},
|
|
|
|
|
"isRisky": 0,
|
|
|
|
|
"waypointWorkType": 0
|
|
|
|
|
};
|
|
|
|
|
let point2 = {
|
|
|
|
|
"Point": {
|
|
|
|
|
"coordinates":item.lng+","+item.lat
|
|
|
|
|
"coordinates":(item.lng+0.00001)+","+(item.lat+0.00001)
|
|
|
|
|
},
|
|
|
|
|
"index": item.id,
|
|
|
|
|
"executeHeight": item.alt - height,
|
|
|
|
@ -1328,7 +1470,7 @@ const handelrAirPoint = () => {
|
|
|
|
|
}else{ // 处理中间航点
|
|
|
|
|
point = {
|
|
|
|
|
"Point": {
|
|
|
|
|
"coordinates":item.lng+","+item.lat
|
|
|
|
|
"coordinates":"\n"+item.lng+","+item.lat+"\n"
|
|
|
|
|
},
|
|
|
|
|
"index": item.id,
|
|
|
|
|
"executeHeight": item.alt - height,
|
|
|
|
|