main
徐景良 1 month ago
parent d8c85b3fca
commit dc2bfd5adb

@ -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,

@ -1081,7 +1081,7 @@ function generateScanLines(polygon, spacing, angle = 0) {
}
// 线
const rotatedLines = lines.map((line) => turf.transformRotate(line, angle, { pivot: center }));
const rotatedLines = lines.map((line) => turf.transformRotate(line, angle - 90, { pivot: center }));
// 线
const coverageLines = [];

Loading…
Cancel
Save