From 64518d2f1410a6b9f590e952632ac83d6f528856 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 21 Jun 2023 08:11:26 +0800 Subject: [PATCH] =?UTF-8?q?[3.3.0]=20[feature]=20[=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E4=BF=A1=E6=81=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrajectoryAndDistanceManager.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/trajectorymamager/TrajectoryAndDistanceManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/trajectorymamager/TrajectoryAndDistanceManager.kt index 0d3931b481..13726d30f5 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/trajectorymamager/TrajectoryAndDistanceManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/trajectorymamager/TrajectoryAndDistanceManager.kt @@ -77,13 +77,15 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{ globalPathResp?.wayPointsList?.let { if (it.size > 0) { d(M_OCHCOMMON + TAG, "收到轨迹:${it.size}第一个点${it[0]}最后一个点:${it.last()}") - if(globalPathResp.lineId == lineId){ - d(M_OCHCOMMON + TAG, "重复轨迹") - startCalculateDistanceLoop() - return + if(globalPathResp.lineId!=null) { + if (globalPathResp.lineId == lineId) { + d(M_OCHCOMMON + TAG, "重复轨迹") + startCalculateDistanceLoop() + return + } + this.lineId = globalPathResp.lineId } endCalculateDistanceLoop() - this.lineId = globalPathResp.lineId updateRoutePoints(it) preCarLocationIndexInTrajectory = 0 startCalculateDistanceLoop() @@ -183,7 +185,7 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{ this.startStationInfo.distance = startStationInfo.third preCarLocationIndexInTrajectory = startStationInfo.first val calculateData = "距离起始站点最近的点:${startStationInfo.first} 点在站的后面:${startStationInfo.second} 距离点的距离:${startStationInfo.third}" - val locationInfo = "定位信息:${location.latitude},${location.longitude},${location.heading}" + val locationInfo = "line信息:${lineId}定位信息:${location.latitude},${location.longitude},${location.heading}" writeLog(calculateData,locationInfo) } @@ -201,7 +203,7 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{ this.endStationInfo.index = endStationInfo.first this.endStationInfo.distance = endStationInfo.third val calculateData = "距离结束站点最近的点:${endStationInfo.first} 点在站的后面:${endStationInfo.second} 距离点的距离:${endStationInfo.third}" - val locationInfo = "定位信息:${location.latitude},${location.longitude},${location.heading}" + val locationInfo = "line信息:${lineId}定位信息:${location.latitude},${location.longitude},${location.heading}" writeLog(calculateData, locationInfo) } @@ -217,7 +219,7 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{ ) } val calculateData = "距离结束站点最近的点:${carLocationInfo.first} 点在站的后面:${carLocationInfo.second} 距离点的距离:${carLocationInfo.third}" - val locationInfo = "定位信息:${location.latitude},${location.longitude},${location.heading}" + val locationInfo = "line信息:${lineId}定位信息:${location.latitude},${location.longitude},${location.heading}" writeLog(calculateData, locationInfo) if(carLocationInfo.second==null||carLocationInfo.third>1_000){ preCarLocationIndexInTrajectory = 0