From 91bc56c338254f18c7651f960d42db13ab541607 Mon Sep 17 00:00:00 2001 From: renwj Date: Mon, 15 Jul 2024 19:42:24 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0][=E9=81=93=E8=B7=AF=E4=BA=8B=E4=BB=B6]?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/functions/test/V2NTest.kt | 4 +-- .../biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 26 +++++++++---------- .../autopilot/telematic/TeleMsgHandler.kt | 20 +++++++++++++- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt b/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt index d8f62f3763..78f15e375f 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt @@ -249,7 +249,7 @@ class V2NTest { CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_PEOPLE_CROSS, data.toByteArray()) CallerV2nNioEventListenerManager.invokeV2nNioCrossoverEvent(data) delay(50) - newPoint = DrivingDirectionUtils.calculateNewPoint(newPoint.first, newPoint.second, targetHeading, 0.1) + newPoint = DrivingDirectionUtils.calculateNewPoint(newPoint.first, newPoint.second, targetHeading, 1.0) } delay(TimeUnit.MINUTES.toMillis(10)) } @@ -289,7 +289,7 @@ class V2NTest { Log.d(TAG, "2 -- > target_distance: $targetDistance, current distance: $distance") var newPoint = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , eventDistance) Log.d(TAG, "location:[x:${targetX}, y:${targetY}, new_location:[x:${newPoint.first}, y:${newPoint.second}]") - val eventId = "yyyyyyyyyyyyy" + val eventId = System.currentTimeMillis().toString() CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { it.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "") }) 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 2f3d1b4eaa..291108a3b9 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 @@ -497,19 +497,19 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } private fun computeCrossCountBetween(start: Triple, end: kotlin.Pair): Int { - val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7) - V2XBizTrace.onAck(points, "computeCrossCountBetween", true) - var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id - val angle = start.third - var count = 1 - for (p in points) { - val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle) - if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) { - count++ - crossId = crossRoad.cross_id - } - } - return count +// val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7) +// V2XBizTrace.onAck(points, "computeCrossCountBetween", true) +// var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id +// val angle = start.third +// var count = 0 +// for (p in points) { +// val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle) +// if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) { +// count++ +// crossId = crossRoad.cross_id +// } +// } + return 1 } private fun getAlertContent(poiType: String, distance: Double): String { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt index b277f967e6..6bcc217bf5 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt @@ -6,6 +6,8 @@ import androidx.lifecycle.lifecycleScope import com.google.protobuf.TextFormat import com.mogo.commons.storage.SharedPrefsMgr import com.mogo.eagle.core.data.app.AppConfigInfo +import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters +import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig @@ -16,6 +18,7 @@ import com.mogo.eagle.core.data.v2x.V2XEvent.RoadEventX import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager @@ -66,7 +69,7 @@ class TeleMsgHandler : IMsgHandler { private var listener: EventListener? = null override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) { - msg?.let { + msg?.let { it -> if (it.protocolType == TelematicConstant.V2N_AI_ROAD_DATA_TO_PASSENGER) { try { Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 1 ---") @@ -84,6 +87,9 @@ class TeleMsgHandler : IMsgHandler { if (it.protocolType == TelematicConstant.V2N_AI_ROAD_PEOPLE_CROSS) { runCatching { + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx -> + itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "") + }) Log.d(TAG, "乘客屏收到司机屏转发云端下发的行人/非机动车横穿事件 --- 1 ---") CallerV2nNioEventListenerManager.invokeV2nNioCrossoverEvent(MessagePad.Event.parseFrom(msg.body)) Log.d(TAG, "乘客屏收到司机屏转发云端下发的行人/非机动车横穿事件 --- 2 ---") @@ -93,6 +99,9 @@ class TeleMsgHandler : IMsgHandler { if (it.protocolType == TelematicConstant.V2N_AI_ROAD_GREEN_WAVE) { runCatching { Log.d(TAG, "乘客屏收到司机屏转发云端下发的绿波通行 --- 1 ---") + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx -> + itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "") + }) CallerV2nNioEventListenerManager.invokeV2nNioGreenWavePassageEvent(MessagePad.V2nCrossSpeed.parseFrom(msg.body)) Log.d(TAG, "乘客屏收到司机屏转发云端下发的绿波通行 --- 2 ---") } @@ -101,6 +110,9 @@ class TeleMsgHandler : IMsgHandler { if (it.protocolType == TelematicConstant.V2N_AI_ROAD_OTHER_RETROGRADE_VEHICLE) { runCatching { Log.d(TAG, "乘客屏收到司机屏转发云端下发的他车逆行 --- 1 ---") + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx -> + itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "") + }) CallerV2nNioEventListenerManager.invokeV2nNioOtherRetrogradeEvent(MessagePad.Event.parseFrom(msg.body)) Log.d(TAG, "乘客屏收到司机屏转发云端下发的他车逆行 --- 2 ---") } @@ -108,6 +120,9 @@ class TeleMsgHandler : IMsgHandler { } if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GONG) { runCatching { + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx -> + itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "") + }) Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 1 ---") CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body))) Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 2 ---") @@ -116,6 +131,9 @@ class TeleMsgHandler : IMsgHandler { } if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GU) { runCatching { + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx -> + itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "") + }) Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 1 ---") CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body))) Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 2 ---")