From dc2a01d4764efd33a23afcaf4f1d7543dc35c4fa Mon Sep 17 00:00:00 2001
From: fctom1215 <fctom1215@outlook.com>
Date: 星期三, 19 二月 2020 15:32:57 +0800
Subject: [PATCH] 上坡地图修正

---
 lib/src/main/cpp/test_items/turn_a90.cpp |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/lib/src/main/cpp/test_items/turn_a90.cpp b/lib/src/main/cpp/test_items/turn_a90.cpp
index f76ac16..cedcaf7 100644
--- a/lib/src/main/cpp/test_items/turn_a90.cpp
+++ b/lib/src/main/cpp/test_items/turn_a90.cpp
@@ -19,7 +19,7 @@
 
 const uint32_t STOP_CAR_TIME = D_SEC(2);
 
-static bool TA90Testing;
+static bool testing;
 
 static int enterAreaHeading;
 static bool turnLeftFinished;
@@ -35,6 +35,7 @@
 void StartTurnA90(int moveDirect, double heading, const struct RtkTime *rtkTime)
 {
     DEBUG("杩涘叆鐩磋杞集鍦哄湴");
+    testing = true;
     enterAreaHeading = (int) heading;
     prevMoveDirect = moveDirect;
     if (moveDirect == 0) {
@@ -47,10 +48,11 @@
 
 int TestTurnA90(const Polygon *map, const car_model *car, const car_model *carPrev, double heading, double speed, int moveDirect, const struct RtkTime *rtkTime)
 {
-    int status = 0;
+    int az = (int) heading;
 
     if (ExitTestArea(map, car)) {
-        status = 1;
+        testing = false;
+        goto TEST_END;
     }
 
     if (CrashRedLine(map, car)) {
@@ -86,15 +88,11 @@
     }
 
     // 妫�鏌ヨ浆鍚戠姸鎬�
-    int az = (int) heading;
-
     if (ABS(az - enterAreaHeading) > 180) {
         az = 360 - ABS(az-enterAreaHeading);
     } else {
         az = ABS(az - enterAreaHeading);
     }
-
-
 
     if (az >= 30) {
         if (!turnLeftFinished) {
@@ -113,8 +111,8 @@
     if (turnLeftFinished) {
 
     }
-
-    return status;
+TEST_END:
+    return testing?0:1;
 }
 
 // 杞﹁疆鏄惁鍘嬭竟绾�

--
Gitblit v1.8.0