From 24428a1b69afcf113883e9cede1159443201a1b8 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期四, 02 四月 2020 18:57:07 +0800
Subject: [PATCH] 进出科目二区域调整

---
 lib/src/main/cpp/test_items2/drive_straight.cpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/src/main/cpp/test_items2/drive_straight.cpp b/lib/src/main/cpp/test_items2/drive_straight.cpp
index 16a8832..8db23e0 100644
--- a/lib/src/main/cpp/test_items2/drive_straight.cpp
+++ b/lib/src/main/cpp/test_items2/drive_straight.cpp
@@ -7,6 +7,7 @@
 #include "../native-lib.h"
 #include "../jni_log.h"
 #include "road_exam.h"
+#include "../master/comm_if.h"
 #include <cmath>
 
 #define DEBUG(fmt, args...)     LOGD("<drive_straight> <%s>: " fmt, __func__, ##args)
@@ -43,6 +44,14 @@
 
     MakeLine(&road_edge, &RoadMapList[index].roadEdgeLine[0].point[0], &RoadMapList[index].roadEdgeLine[0].point[1]);
 
+    {
+        double l1 = DistanceOf(car->carXY[car->right_front_tire[TIRE_OUTSIDE]], road_edge);
+
+        double l2 = DistanceOf(car->carXY[car->right_rear_tire[TIRE_OUTSIDE]], road_edge);
+
+        MA_SendDistance(-1, (l1+l2)/2.0);
+    }
+
     if (!crossStartLine) {
         PointF p1, p2;
 

--
Gitblit v1.8.0