From 2cfc22e1ea5140861499ee5b7142766fb8f754f7 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期二, 29 九月 2020 15:53:20 +0800 Subject: [PATCH] 坐标 --- lib/src/main/cpp/test_items/park_bottom.cpp | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/src/main/cpp/test_items/park_bottom.cpp b/lib/src/main/cpp/test_items/park_bottom.cpp index 7872b06..5854125 100644 --- a/lib/src/main/cpp/test_items/park_bottom.cpp +++ b/lib/src/main/cpp/test_items/park_bottom.cpp @@ -33,6 +33,8 @@ static int mapIndex = 0; const uint32_t STOP_CAR_TIME = D_SEC(2); +const uint32_t CHECK_PARK_DELAY = 400; + static uint32_t stopTimepoint; static int prevMoveDirect, storeMoveDirectBeforeStop; static bool occurCrashRedLine; @@ -165,7 +167,7 @@ stopTimepoint = tp; storeMoveDirectBeforeStop = prevMoveDirect; if (prevMoveDirect == -1) { - checkPartStatus = true; + checkPartStatus = true; // 姣忔鍊掕溅鍋滄锛岃Е鍙戝叆搴撴鏌� } DEBUG("鍋滆溅浜� %d %d %d %d %d %d %d", rtkTime->YY, rtkTime->MM, rtkTime->DD, rtkTime->hh, rtkTime->mm, rtkTime->ss, rtkTime->mss); @@ -198,14 +200,10 @@ } } else { // 鍒囨崲涓哄墠杩� - if (tp - stopTimepoint >= STOP_CAR_TIME) { + DEBUG("鍒囨崲涓哄墠杩�"); + + if (tp - stopTimepoint >= CHECK_PARK_DELAY) { if (crossCtrlLineSw) { - if (checkPartStatus) { - if (EnterParking(map, car)) { - parkStatus[parkCount] = 1; - } - checkPartStatus = false; - } if (parkStatus[parkCount] != 1) { // 鍊掑簱涓嶅叆锛屼笉鍚堟牸 reportParkFail = true; @@ -234,7 +232,7 @@ firstReverseTimepoint = tp; } } else if (moveDirect == 0 && crossCtrlLineSw) { - if (tp - stopTimepoint >= STOP_CAR_TIME && checkPartStatus) { + if (tp - stopTimepoint >= CHECK_PARK_DELAY && checkPartStatus) { if (EnterParking(map, car)) { parkStatus[parkCount] = 1; } -- Gitblit v1.8.0