优化无人机轨迹延迟问题

main
刘妍 2 months ago
parent 1894ac682e
commit 945553caf9

@ -1,15 +1,15 @@
<template>
<div class="airport-information" v-if="airportVal">
<div class="title"
>机场信息<span v-if="airportVal.flighttask_step_code">
<template v-if="airportVal.flighttask_step_code == 0"></template>
<template v-else-if="airportVal.flighttask_step_code == 1">飞行作业中</template>
<template v-else-if="airportVal.flighttask_step_code == 2">作业后状态恢复</template>
<template v-else-if="airportVal.flighttask_step_code == 3">自定义飞行区更新中</template>
<template v-else-if="airportVal.flighttask_step_code == 4">地形障碍物更新中</template>
<template v-else-if="airportVal.flighttask_step_code == 5">任务空闲</template>
<template v-else-if="airportVal.flighttask_step_code == 255">飞行器异常</template>
<template v-else-if="airportVal.flighttask_step_code == 256">未知状态</template>
>机场信息<span v-if="flighttask_step_code">
<template v-if="flighttask_step_code == 0"></template>
<template v-else-if="flighttask_step_code == 1">飞行作业中</template>
<template v-else-if="flighttask_step_code == 2">作业后状态恢复</template>
<template v-else-if="flighttask_step_code == 3">自定义飞行区更新中</template>
<template v-else-if="flighttask_step_code == 4">地形障碍物更新中</template>
<template v-else-if="flighttask_step_code == 5">任务空闲</template>
<template v-else-if="flighttask_step_code == 255">飞行器异常</template>
<template v-else-if="flighttask_step_code == 256">未知状态</template>
</span>
<span v-else></span>
</div>
@ -89,8 +89,8 @@
msgData: Object,
});
console.log(props);
const flighttask_step_code = ref(0);
const airportVal: any = ref({
flighttask_step_code: 0,
wind_speed: 0,
environment_temperature: 0,
temperature: 0,
@ -116,7 +116,7 @@
val.message.data.flighttask_step_code
) {
// console.log(val);
airportVal.value.flighttask_step_code = val.message.data.flighttask_step_code;
flighttask_step_code.value = val.message.data.flighttask_step_code;
time.value = timestampToFormattedDate(val.message.timestamp);
}
},

@ -536,7 +536,9 @@
if (props.airPort) {
setAirportPosition();
}
setUAVPosition();
if (props.uavTrack) {
setUAVPosition();
}
});
};
@ -1589,40 +1591,31 @@
graphicLayer.addGraphic(startGraphic);
}
};
const uavList = ref([]);
//
const setUAVPosition = () => {
const position = [props.uavTrack.longitude, props.uavTrack.latitude, props.uavTrack.height];
let flag1 = uavList.value.findIndex((item) => {
return item == position;
});
if (flag1 == -1) {
uavList.value.push(position);
let route = graphicLayer.getGraphicById('uav-route');
if (!route) {
route = new mars3d.graphic.Route({
id: 'uav-route',
polyline: {
color: '#3388ff',
width: 2,
},
flyTo: true,
});
graphicLayer.addGraphic(route);
}
const fixedRoute = new mars3d.graphic.FixedRoute({
name: '步行路线',
position: {
type: 'time', //
speed: 700,
pauseTime: 0.5,
list: uavList.value,
},
frameRate: 1,
showStop: true,
polyline: {
color: '#3388ff',
width: 2,
},
});
graphicLayer.addGraphic(fixedRoute);
// fixedRoute.openPopup() // popup
if (uavList.value.length > 1) {
fixedRoute.start();
if (props.uavTrack.longitude) {
const positionVal = Cesium.Cartesian3.fromDegrees(
props.uavTrack.longitude,
props.uavTrack.latitude,
props.uavTrack.height,
);
route.addTimePosition(positionVal);
}
let point = graphicLayer.getGraphicById('set-uav');
const position = [props.uavTrack.longitude, props.uavTrack.latitude, props.uavTrack.height];
//
if (point) {
point.setOptions({

Loading…
Cancel
Save