From 0a1d7f85ffc4f1fac22d6833659c3ad629106ecb Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 16 Jul 2025 17:28:10 +0800 Subject: [PATCH] =?UTF-8?q?[8.1.2][opt]=E9=A2=84=E6=B5=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=96=B0=E5=A2=9E=E4=BA=9B=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/identify/MapIdentifySubscriber.kt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt index 17a8176d08..6897662974 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt @@ -7,17 +7,16 @@ import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.api.base.IMoGoSubscriber import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener -import com.mogo.eagle.core.function.business.routeoverlay.PredictionDataManager import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getLocationHeading import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lat import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lon import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.map.MogoMap import com.mogo.map.MogoMap.Companion.mapInstance -import com.mogo.map.utils.LocationUtils import com.zhjt.mogo.adas.data.Adas.TrackedObjectClassID import com.zhjt.mogo.adas.data.Adas.TrackedObjectType import mogo.telematics.pad.MessagePad @@ -119,14 +118,23 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber, // PredictionDataManager.getInstance()?.updateData(carPoiList1!!, 0) // PredictionDataManager.getInstance()?.updateData(carPoiList2!!, 2) } else { - if (isUnKnownType(preObj.classtype) || preObj.predictionTrajectoryList.isNullOrEmpty() || mogoMap == null) return@forEach + if (isUnKnownType(preObj.classtype) || preObj.predictionTrajectoryList.isNullOrEmpty() || mogoMap == null) { + CallerLogger.d(TAG, "未知感知物或者没有预测数据或者地图实例拿不到,直接返回!") + return@forEach + } point = preObj.predictionTrajectoryList[0].trajectoryPointsList[0] arr = mogoMap.switchData(point.x, point.y, false) arr?.let { lonLatArr -> // 感知物不在当前视椎体内则不渲染其预测轨迹 - if (!mogoMap.isInCurrentFrame(lonLatArr[0], lonLatArr[1])) return@forEach + if (!mogoMap.isInCurrentFrame(lonLatArr[0], lonLatArr[1])) { + CallerLogger.d(TAG, "当前它车感知物不在视椎体内,不渲染预测轨迹!") + return@forEach + } val distance = com.mogo.eagle.core.utilcode.util.LocationUtils.getDistance(getWgs84Lat(), getWgs84Lon(), lonLatArr[1], lonLatArr[0]) - if (distance > 28) return@forEach + if (distance > 28) { + CallerLogger.d(TAG, "当前它车感知物距离自车大于28米,不渲染预测轨迹!") + return@forEach + } } preObj.predictionTrajectoryList[0].trajectoryPointsList.forEachIndexed { index, point -> if (index in 0..44 && index % 2 == 0) {// 步长为2,减少点