From 763e39bd71d83a6501ebdebf0d53130797bd5d73 Mon Sep 17 00:00:00 2001
From: sean.zhou <sean.zhou@dji.com>
Date: Thu, 18 May 2023 16:26:09 +0800
Subject: [PATCH] Merge branch 'v1.5.0' What's new? 1. Add new model: DJI Matrices 350 RTK. 2. Fixed some issues.
---
src/components/g-map/use-manual-control.ts | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/components/g-map/use-manual-control.ts b/src/components/g-map/use-manual-control.ts
index eb178a8..96055d1 100644
--- a/src/components/g-map/use-manual-control.ts
+++ b/src/components/g-map/use-manual-control.ts
@@ -30,7 +30,7 @@
export function useManualControl (deviceTopicInfo: DeviceTopicInfo, isCurrentFlightController: Ref<boolean>) {
const activeCodeKey = ref(null) as Ref<KeyCode | null>
const mqttHooks = useMqtt(deviceTopicInfo)
-
+ let seq = 0
function handlePublish (params: DroneControlProtocol) {
const body = {
method: DRC_METHOD.DRONE_CONTROL,
@@ -38,8 +38,9 @@
}
handleClearInterval()
myInterval = setInterval(() => {
+ body.data.seq = seq++
+ seq++
window.console.log('keyCode>>>>', activeCodeKey.value, body)
- body.data.seq = new Date().getTime()
mqttHooks?.publishMqtt(deviceTopicInfo.pubTopic, body, { qos: 0 })
}, 50)
}
@@ -52,6 +53,7 @@
const SPEED = 5 // check
const HEIGHT = 5 // check
const W_SPEED = 20 // 机头角速度
+ seq = 0
switch (keyCode) {
case 'KeyA':
if (activeCodeKey.value === keyCode) return
@@ -105,6 +107,7 @@
function resetControlState () {
activeCodeKey.value = null
+ seq = 0
handleClearInterval()
}
--
Gitblit v1.9.3