From 95645bf39717e49b45bfd1c0630581957e941e42 Mon Sep 17 00:00:00 2001 From: renwj Date: Tue, 28 Mar 2023 20:09:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[2.15.0]=20V2N=E4=BA=8B=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E8=BD=A6=E8=BF=9C=E7=AB=AF=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/function/biz/FuncBizProvider.kt | 4 + .../function/biz/v2x/v2n/V2XEventManager.kt | 17 +- .../biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 155 ++++++++++++++++++ .../v2n/scenario/scene/airoad/AiRoadMarker.kt | 8 +- .../scene/road/V2XAiRoadEventMarker.kt | 2 +- 5 files changed, 171 insertions(+), 15 deletions(-) create mode 100644 core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt index cb9be5403d..ac999a64b0 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt @@ -20,6 +20,7 @@ import com.mogo.eagle.function.biz.v2x.road.LineUploadManager import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader.Companion.v2xPoiLoader +import com.mogo.eagle.function.biz.v2x.v2n.pnc.* import com.mogo.eagle.function.biz.v2x.vip.VipCarManager @Route(path = MogoServicePaths.PATH_FUNC_BIZ) @@ -46,6 +47,8 @@ class FuncBizProvider : IMoGoFuncBizProvider { LineUploadManager.getInstance(context)?.init() } V2xObuEventManager.init(context) + + V2NIdentifyDrawer.init() // RedLightWarningManager.INSTANCE.listenTrafficLight() } @@ -113,6 +116,7 @@ class FuncBizProvider : IMoGoFuncBizProvider { } } V2xObuEventManager.release() + V2NIdentifyDrawer.unInit() // RedLightWarningManager.INSTANCE.onDestroy() } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt index 8ac9e08005..8519319a96 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt @@ -61,6 +61,7 @@ import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import java.util.concurrent.atomic.AtomicBoolean import mogo.telematics.pad.MessagePad +import mogo.telematics.pad.MessagePad.PlanningObject object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback, IMoGoAutopilotIdentifyListener, IMoGoCloudListener { @@ -178,15 +179,13 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback, paramIndexes = [0], clientPkFileName = "sn" ) - override fun onAutopilotIdentifyPlanningObj(planningObjects: List?) { + override fun onAutopilotIdentifyPlanningObj(planningObjects: List?) { super.onAutopilotIdentifyPlanningObj(planningObjects) planningObjects?.let { if (it.isNotEmpty()) { - val first = it.stream() - .filter { planningObj: MessagePad.PlanningObject -> planningObj.type >= 1000 } - .findFirst() - if (first.isPresent) { - val poiType = when (first.get().type) { + val first = it.firstOrNull { planningObj: PlanningObject -> planningObj.type >= 1000 } + if (first != null) { + val poiType = when (first.type) { // 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物 // } 1005 -> { //V2N_RSI,施工事件,包括锥桶或者挡板围城的施工场景,是个多边形包围区域 @@ -199,11 +198,11 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback, return } } - CallerLogger.d("$M_V2X$TAG", "poiType : $poiType , 触发道路事件") + Logger.d("$M_V2X$TAG", "poiType : $poiType , 触发道路事件") val trackedObj = - CallerMapIdentifyManager.getIdentifyObj(first.get().uuid.toString()) + CallerMapIdentifyManager.getIdentifyObj(first.uuid.toString()) trackedObj?.let { t -> - CallerLogger.d("$M_V2X$TAG", "polygon size : ${(t.polygonList.size)}") + Logger.d("$M_V2X$TAG", "polygon size : ${(t.polygonList.size)}") val v2XMessageEntity = V2XMessageEntity() v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING v2XMessageEntity.content = t.toRoadMarker(poiType).toV2XRoadEventEntity() diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt new file mode 100644 index 0000000000..50737dd37f --- /dev/null +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -0,0 +1,155 @@ +package com.mogo.eagle.function.biz.v2x.v2n.pnc + +import android.os.* +import androidx.core.util.* +import com.mogo.eagle.core.data.enums.* +import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP +import com.mogo.eagle.core.data.map.entity.* +import com.mogo.eagle.core.data.msgbox.* +import com.mogo.eagle.core.data.msgbox.MsgBoxType.V2X +import com.mogo.eagle.core.function.api.autopilot.* +import com.mogo.eagle.core.function.api.hmi.warning.* +import com.mogo.eagle.core.function.api.map.angle.* +import com.mogo.eagle.core.function.call.autopilot.* +import com.mogo.eagle.core.function.call.hmi.* +import com.mogo.eagle.core.function.call.map.* +import com.mogo.eagle.core.function.call.msgbox.* +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox +import com.mogo.eagle.core.utilcode.mogo.logger.* +import com.mogo.eagle.core.utilcode.util.* +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.* +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker +import mogo.telematics.pad.MessagePad.TrackedObject + +/** + * V2N上车相关事件绘制 + */ +internal object V2NIdentifyDrawer { + + + private const val TAG = "V2NIdentifyDataSubscriber" + + private const val MSG_WHAT_DRAW_ALL = 0x1010 + + private val callback = Handler.Callback { msg -> + if (msg.what == MSG_WHAT_DRAW_ALL) { + val events = msg.obj as? List<*> + if (events == null || events.isEmpty()) { + return@Callback true + } + val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx -> + val diff = DrivingDirectionUtils.getAngleDiff(car.heading, itx.heading) + diff < 40 && DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, itx.longitude, itx.latitude, car.heading.toInt()) <= 90 + } + if (filtered.isEmpty()) { + return@Callback true + } + filtered.forEach { itx -> + AiRoadMarker.aiMakers.getOrPut(itx.uuid.toString()) { + AiRoadMarker().apply { + val poiType = getPoiType(itx.type).poiType + val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) } + marker(Marker(itx.strUuid, poiType, itx.longitude, itx.latitude, itx.heading, polygon, null, + V2XRoadEventEntity().also { e -> + e.poiType = poiType + e.location = MarkerLocation().also { l -> + val p = CoordinateTransform.WGS84ToGCJ02(itx.longitude, itx.latitude) + l.lon = p[0] + l.lat = p[1] + l.angle = itx.heading + } + e.noveltyInfo = MarkerExploreWay().also { + it.poiType = poiType + it.location = e.location + it.polygon = polygon + } + }), true, isDrawRoadLine(poiType)) + + val distance = CoordinateUtils.calculateLineDistance(itx.longitude, itx.latitude, car.longitude, car.latitude) + val alertContent = getAlertContent(poiType, distance.toDouble()) + val ttsContent = getTtsContent(poiType, distance.toDouble()) + saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent))) + CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener { + override fun onShow() { + super.onShow() + CallerVisualAngleManager.changeAngle(RoadEvent) + } + + override fun onDismiss() { + super.onDismiss() + CallerVisualAngleManager.changeAngle(Default()) + } + }, ALERT_WARNING_TOP, 10000) + } + }.receive() + } + } + true + } + + private fun getTtsContent(poiType: String, distance: Double): String { + return when (poiType) { + EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType -> { + "前方${distance.toInt()}米道路施工" + } + EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.poiType -> { + "前方${distance.toInt()}米交通事故" + } + else -> { + throw AssertionError("error!!!") + } + } + } + + private fun getAlertContent(poiType: String, distance: Double): String { + return when(poiType) { + EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType -> { + "前方${distance.toInt()}米道路施工" + } + EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.poiType -> { + "前方${distance.toInt()}米交通事故" + } + else -> { + throw AssertionError("error!!!") + } + } + } + + private fun isDrawRoadLine(poiType: String): Boolean { + return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType == poiType + } + + private fun getPoiType(type: Int): EventTypeEnumNew = if (type == 501 || type == 502) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG else if (type == 13) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU else throw AssertionError("error!!!") + + private val handler by lazy { + val thread = HandlerThread("v2n_identify_drawer") + thread.start() + Handler(thread.looper, callback) + } + + private val listener = object : IMoGoAutopilotIdentifyListener { + + override fun onAutopilotIdentifyDataUpdate(trafficData: List?) { + super.onAutopilotIdentifyDataUpdate(trafficData) + val events = trafficData?.filter { it.type == 501 || it.type == 502 || it.type == 13 } + Logger.d(TAG, "--- onAutopilotIdentifyDataUpdate -- : trafficData: ${ trafficData?.joinToString(",") }") + if (events != null && events.isNotEmpty()) { + draw(events) + } + } + } + + private fun draw(events: List) { + handler.removeMessages(MSG_WHAT_DRAW_ALL) + handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_ALL, events)) + } + + fun init() { + CallerAutopilotIdentifyListenerManager.addListener(TAG, listener) + } + + fun unInit() { + CallerAutopilotIdentifyListenerManager.removeListener(TAG) + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt index 279ec76a4e..4bdc6f8bd3 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt @@ -73,7 +73,7 @@ class AiRoadMarker { } fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) { - val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() ?: return + val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() this.marker.set(marker) val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, null, null) if (drawMarker) { @@ -174,7 +174,7 @@ class AiRoadMarker { Logger.d(TAG, "receive --- 1 ---") val poi = this.marker.get() val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() - if (poi != null && car != null) { + if (poi != null) { val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) Logger.d(TAG, "receive --- 2 ---:car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance") if (distance < 500) { @@ -183,9 +183,7 @@ class AiRoadMarker { handler.removeCallbacks(checkExpiredTask) } } else { - if (poi != null) { - checkExpired() - } + checkExpired() } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt index 6ffc579935..92c0ee63a2 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -33,7 +33,7 @@ class V2XAiRoadEventMarker { val points = ArrayList() for (p in polygon) { - points.add(MogoLatLng(p.first, p.second)) + points.add(MogoLatLng(p.second, p.first)) } if (points.size > 2) { points.add(points[0]) From f32c5a3b2b07020357eb6d367d2a3beb7d3b2f5e Mon Sep 17 00:00:00 2001 From: renwj Date: Tue, 28 Mar 2023 21:02:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[2.15.0]=20=E4=BC=98=E5=8C=96=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 6 +++--- .../function/biz/v2x/v2n/remove/MarkerRemoveManager.kt | 5 +++-- .../biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt | 4 ++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index 50737dd37f..216188d49c 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -13,7 +13,6 @@ import com.mogo.eagle.core.function.api.map.angle.* import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.hmi.* import com.mogo.eagle.core.function.call.map.* -import com.mogo.eagle.core.function.call.msgbox.* import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox import com.mogo.eagle.core.utilcode.mogo.logger.* import com.mogo.eagle.core.utilcode.util.* @@ -46,11 +45,12 @@ internal object V2NIdentifyDrawer { return@Callback true } filtered.forEach { itx -> - AiRoadMarker.aiMakers.getOrPut(itx.uuid.toString()) { + val id = itx.uuid.toString() + AiRoadMarker.aiMakers.getOrPut(id) { AiRoadMarker().apply { val poiType = getPoiType(itx.type).poiType val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) } - marker(Marker(itx.strUuid, poiType, itx.longitude, itx.latitude, itx.heading, polygon, null, + marker(Marker(id, poiType, itx.longitude, itx.latitude, itx.heading, polygon, null, V2XRoadEventEntity().also { e -> e.poiType = poiType e.location = MarkerLocation().also { l -> diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt index ee8a0c7372..310481a8e9 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicReference -data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList? = null, var lines: ArrayList? = null) { +data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList? = null, var lines: ArrayList? = null, var onRemoved:((id: String) -> Unit)? = null) { fun addLine(line: IMogoPolyline) { var ll = this.lines @@ -108,7 +108,7 @@ object MarkerRemoveManager { elapsed += delta } Log.d(TAG, "--- checkTask --- 5 ---:delta:$delta, elapsed:${elapsed}, id: ${marker.id}") - if (elapsed >= 200) { + if (elapsed >= 100) { var removeMarkerError = false marker.markers?.forEach { try { @@ -137,6 +137,7 @@ object MarkerRemoveManager { toRemove.remove() synchronized(elapsedDistances) { elapsedDistances.remove(marker) + marker.onRemoved?.invoke(marker.id) } } } else { diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt index 4bdc6f8bd3..44ad54851b 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt @@ -148,6 +148,9 @@ class AiRoadMarker { wrapper.addLine(line) } } + wrapper.onRemoved = { id -> + aiMakers.remove(id) + } MarkerRemoveManager.addMarker(wrapper) } @@ -168,6 +171,7 @@ class AiRoadMarker { removeLine() roadMarker.removeMarkers() handler.removeCallbacks(checkExpiredTask) + aiMakers.remove(marker.id) } fun receive() { From 93c1aacc7d69a90089b93bf9e24a01dae180c790 Mon Sep 17 00:00:00 2001 From: renwj Date: Wed, 29 Mar 2023 11:27:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[2.15.0]=20=E4=B8=8D=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=87=AA=E8=BD=A6=E8=88=AA=E5=90=91=E4=B8=8E=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E8=88=AA=E5=90=91=E8=A7=92=E6=98=AF=E5=90=A6=E5=90=8C=E5=90=91?= =?UTF-8?q?,=E7=94=B1=E6=95=B0=E6=8D=AE=E4=BE=A7=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=9D=9E=E8=87=AA=E8=BD=A6=E8=88=AA=E5=90=91?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E4=BA=8B=E4=BB=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 3 +-- .../function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index 216188d49c..8cfd2a9710 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -38,8 +38,7 @@ internal object V2NIdentifyDrawer { } val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx -> - val diff = DrivingDirectionUtils.getAngleDiff(car.heading, itx.heading) - diff < 40 && DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, itx.longitude, itx.latitude, car.heading.toInt()) <= 90 + DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, itx.longitude, itx.latitude, car.heading.toInt()) <= 90 } if (filtered.isEmpty()) { return@Callback true diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt index 44ad54851b..9450162a65 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt @@ -55,7 +55,7 @@ class AiRoadMarker { private val checkExpiredTask = Runnable { val poi = this.marker.get() val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() - if (poi != null && car != null) { + if (poi != null) { val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) if (distance < 500) { unMarker(poi)