From cff87234c496f0a4522cd2ac57941f14c729b6ad Mon Sep 17 00:00:00 2001
From: fctom1215 <fctom1215@outlook.com>
Date: 星期五, 28 八月 2020 01:05:09 +0800
Subject: [PATCH] 坐标
---
lib/src/main/cpp/test_common/odo_graph.cpp | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/src/main/cpp/test_common/odo_graph.cpp b/lib/src/main/cpp/test_common/odo_graph.cpp
index 1266a1b..977fc23 100644
--- a/lib/src/main/cpp/test_common/odo_graph.cpp
+++ b/lib/src/main/cpp/test_common/odo_graph.cpp
@@ -8,7 +8,7 @@
#include "../utils/xconvert.h"
static double odoGraph;
-static struct drive_timer odoTimer;
+static struct RtkTime odoTimer;
static double odoPrevSpeed;
static int odoCnt;
@@ -28,15 +28,13 @@
if (odoCnt == 0 && moveDirect == 1) {
odoPrevSpeed = speed;
odoCnt = 1;
- Rtk2DriveTimer(odoTimer, rtkTime);
+ odoTimer = *rtkTime;
} else if (odoCnt == 1) {
if (moveDirect == 1) {
- uint32_t tm = TimeGetDiff(rtkTime->hh, rtkTime->mm, rtkTime->ss, rtkTime->mss * 10,
- odoTimer.hour, odoTimer.min, odoTimer.sec,
- odoTimer.msec * 10);
+ uint32_t tm = TimeGetDiff(rtkTime, &odoTimer);
if (tm >= D_SEC(1)) {
odoGraph += ((double) tm) * (odoPrevSpeed + speed) / 2.0 / 1000.0;
- Rtk2DriveTimer(odoTimer, rtkTime);
+ odoTimer = *rtkTime;
odoPrevSpeed = speed;
}
} else {
--
Gitblit v1.8.0