From c484cbb09d445e2ab30ea011c6d2ffd87202bb26 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期五, 23 十月 2020 18:05:34 +0800 Subject: [PATCH] 添加可用户配置的评判参数。 --- lib/src/main/cpp/test_items2/drive_straight.cpp | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/src/main/cpp/test_items2/drive_straight.cpp b/lib/src/main/cpp/test_items2/drive_straight.cpp index 8b7d1cf..44d120a 100644 --- a/lib/src/main/cpp/test_items2/drive_straight.cpp +++ b/lib/src/main/cpp/test_items2/drive_straight.cpp @@ -14,9 +14,6 @@ #define DEBUG(fmt, args...) LOGD("<road_exam drive_straight> <%s>: " fmt, __func__, ##args) -static const double CHECK_STAGE_DISTANCE = 100.0; -static const double MAX_OFFSET_DISTANCE = 0.3; - static int setup; static double beginOdo; static int yaw_stat; @@ -31,7 +28,7 @@ DEBUG("寮�濮嬬洿绾胯椹�"); setup = 0; yaw_stat = 0; - PlayTTS("璇蜂繚鎸佺洿绾胯椹�", TtsBack); + PlayTTS(examParam.straight_begin_tts, TtsBack); } bool TestDriveStraight(road_exam_map &RoadMap, int roadIndex, const car_model *car, const struct RtkTime *rtkTime) { @@ -70,7 +67,7 @@ } else if (setup == 2) { offset1 = DistanceOf(car->carXY[car->axial[AXIAL_FRONT]], baseLine); - if (offset1 > MAX_OFFSET_DISTANCE) { + if (offset1 > examParam.straight_max_offset) { DEBUG("铏氭嫙鐩寸嚎鍋忕Щ澶т簬30鍘樼背 offset1 = %f", offset1); // // 鍋忕Щ澶т簬30鍘樼背锛屼笉鍚堟牸 // AddExamFault(30, rtkTime); @@ -80,7 +77,7 @@ PointF px = CalcProjectionWithRoadEdge(RoadMap.roads[roadIndex].rightEdge, car->carXY[car->axial[AXIAL_FRONT]]); offset2 = DistanceOf(px, car->carXY[car->axial[AXIAL_FRONT]]); - if (fabs(offset2 - offsetBase) > MAX_OFFSET_DISTANCE) { + if (fabs(offset2 - offsetBase) > examParam.straight_max_offset) { DEBUG("鐩寸嚎鍋忕Щ澶т簬30鍘樼背 offset2 = %f", fabs(offset2 - offsetBase)); // 鍋忕Щ澶т簬30鍘樼背锛屼笉鍚堟牸 AddExamFault(30, rtkTime); @@ -88,10 +85,10 @@ } } - if (setup == 2 && ReadOdo() - beginOdo > CHECK_STAGE_DISTANCE) { + if (setup == 2 && ReadOdo() - beginOdo > examParam.straight_limit_distance) { DEBUG("鐩寸嚎琛岄┒缁撴潫 offset1 = %f offset2 = %f", offset1, fabs(offset2 - offsetBase)); - PlayTTS("鐩寸嚎琛岄┒缁撴潫", NULL); + PlayTTS(examParam.straight_end_tts, NULL); return false; } -- Gitblit v1.8.0