From d79866b554376b997309e96060a252e84cf97e4a Mon Sep 17 00:00:00 2001 From: renwj Date: Wed, 10 Jul 2024 16:52:11 +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=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86=E4=B8=8A=E8=BD=A6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E5=9D=90=E6=A0=87=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91=EF=BC=9B=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=81=93=E8=B7=AF=E6=96=BD=E5=B7=A5=E5=92=8C=E9=81=93=E8=B7=AF?= =?UTF-8?q?=E4=BA=8B=E6=95=85=E7=9A=84=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 1 + .../java/com/mogo/functions/test/V2NTest.kt | 103 +++++++++++++++++- .../biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 43 +++----- .../v2n/scenario/scene/airoad/AiRoadMarker.kt | 7 +- .../scene/road/V2XRoadEventMarker.java | 2 +- .../autopilot/telematic/TeleMsgHandler.kt | 19 ++++ .../data/multidisplay/TelematicConstant.kt | 6 + 7 files changed, 148 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1adad2b449..101a12d2e0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -232,6 +232,7 @@ dependencies { androidTestImplementation rootProject.ext.dependencies.localbroadcastmanager androidTestImplementation rootProject.ext.dependencies.downloader androidTestImplementation project(":libraries:mogo-map") + androidTestImplementation rootProject.ext.dependencies.jts_core } 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 2b1fda75fd..facc8c0bcd 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt @@ -9,6 +9,7 @@ import androidx.test.platform.app.InstrumentationRegistry import com.google.protobuf.ByteString import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.multidisplay.TelematicConstant +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager @@ -20,12 +21,16 @@ import com.mogo.map.MapDataWrapper import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import mogo.telematics.pad.MessagePad +import mogo.telematics.pad.MessagePad.Location +import mogo.telematics.pad.MessagePad.TrackedObject import mogo.telematics.pad.MessagePad.V2nCrossSpeed import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import java.util.HashMap +import java.util.Collections import java.util.concurrent.TimeUnit +import kotlin.math.cos +import kotlin.math.sin @RunWith(AndroidJUnit4::class) @@ -43,6 +48,100 @@ class V2NTest { launch = ActivityScenario.launch(MainLauncherActivity::class.java) } + @Test + fun testRoadShiGong(): Unit = runBlocking { + val arguments = InstrumentationRegistry.getArguments() + val millis = arguments.getString("delay", "0").toLong() + if (millis > 0) { + delay(millis) + } + FunctionBuildConfig.isNewV2NData = true + FunctionBuildConfig.v2nMainSwitch = true + runCatching { + val map = HashMap().also { + it["f1"] = FunctionBuildConfig.v2nMainSwitch + it["f2"] = FunctionBuildConfig.isNewV2NData + } + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) + } + delay(2000) + val targetX = arguments.getString("lon", "0").toDouble() + val targetY = arguments.getString("lat", "0").toDouble() + val targetDistance = arguments.getString("distance", "0").toDouble() + val eventDistance = arguments.getString("event_distance", "50").toDouble() + val r = arguments.getString("r", "1").toDouble() + var car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + var distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, targetX, targetY) + Log.d(TAG, "target_distance: $targetDistance, current distance: $distance, event_distance: $eventDistance") + while (distance > targetDistance) { + delay(2000) + car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, targetX, targetY) + Log.d(TAG, "target_distance: $targetDistance, current distance: $distance") + } + car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + val point = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , eventDistance) + val polygon = generateTriangle(point.first, point.second, car.heading, r * 1e-5) + val data = TrackedObject.getDefaultInstance().toBuilder().setType(501).setLongitude(point.first).setLatitude(point.second).setAltitude(0.0).setSystemTime(System.currentTimeMillis() * 1.0 / 1000).setSatelliteTime(1.0).setUuid(10).setCarID("1").setColor("#ffffff").setHeading(car.heading).setSpeed(0.0).setDrawLevel(1).setDriverTime(1.0).setCameraIp("172.18.7.40").setVideoUrl("").addAllImageUrl(Collections.singletonList("http://www.baidu.com")).addAllPolygon(polygon.map { Location.getDefaultInstance().toBuilder().setLongitude(it.first).setLatitude(it.second).setAltitude(0.0).setHeading(0.0).setStation(false).build() }).setDetectStartTime(System.currentTimeMillis()).setV2XUuid("xxxxx1").setStrUuid("xxxxx2").build() + val trafficData = Collections.singletonList(data) + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_SHI_GONG, data.toByteArray()) + CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(trafficData) + delay(TimeUnit.MINUTES.toMillis(10)) + } + + @Test + fun testRoadShiGu(): Unit = runBlocking { + val arguments = InstrumentationRegistry.getArguments() + val millis = arguments.getString("delay", "0").toLong() + if (millis > 0) { + delay(millis) + } + FunctionBuildConfig.isNewV2NData = true + FunctionBuildConfig.v2nMainSwitch = true + runCatching { + val map = HashMap().also { + it["f1"] = FunctionBuildConfig.v2nMainSwitch + it["f2"] = FunctionBuildConfig.isNewV2NData + } + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) + } + delay(2000) + val targetX = arguments.getString("lon", "0").toDouble() + val targetY = arguments.getString("lat", "0").toDouble() + val targetDistance = arguments.getString("distance", "0").toDouble() + val eventDistance = arguments.getString("event_distance", "0").toDouble() + val r = arguments.getString("r", "1").toDouble() + var car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + var distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, targetX, targetY) + Log.d(TAG, "target_distance: $targetDistance, current distance: $distance, event_distance: $eventDistance") + while (distance > targetDistance) { + delay(2000) + car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, targetX, targetY) + Log.d(TAG, "target_distance: $targetDistance, current distance: $distance") + } + car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + val point = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , eventDistance) + val polygon = generateTriangle(point.first, point.second, car.heading, r * 1e-5) + val data = TrackedObject.getDefaultInstance().toBuilder().setType(13).setLongitude(point.first).setLatitude(point.second).setAltitude(0.0).setSystemTime(System.currentTimeMillis() * 1.0 / 1000).setSatelliteTime(1.0).setUuid(10).setCarID("1").setColor("#ffffff").setHeading(car.heading).setSpeed(0.0).setDrawLevel(1).setDriverTime(1.0).setCameraIp("172.18.7.40").setVideoUrl("").addAllImageUrl(Collections.singletonList("http://www.baidu.com")).addAllPolygon(polygon.map { Location.getDefaultInstance().toBuilder().setLongitude(it.first).setLatitude(it.second).setAltitude(0.0).setHeading(0.0).setStation(false).build() }).setDetectStartTime(System.currentTimeMillis()).setV2XUuid("xxxxx1").setStrUuid("xxxxx2").build() + val trafficData = Collections.singletonList(data) + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_SHI_GU, data.toByteArray()) + CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(trafficData) + delay(TimeUnit.MINUTES.toMillis(10)) + } + + private fun generateTriangle(x: Double, y: Double, angle: Double, r: Double): List> { + val angles = arrayOf(0, 120, 240) + val coordinates = ArrayList>() + for(i in 0 until 3) { + val radian = Math.toRadians(angles[i] + angle) + val x1 = x + (r * cos(radian)) + val y1 = y + (r * sin(radian)) + coordinates += Pair(x1, y1) + } + coordinates.add(coordinates[0]) + return coordinates + } @Test fun testGreenWave(): Unit = runBlocking { @@ -164,8 +263,6 @@ class V2NTest { Log.d(TAG, "location:[x:${targetX}, y:${targetY}, new_location:[x:${newPoint.first}, y:${newPoint.second}]") FunctionBuildConfig.isNewV2NData = true FunctionBuildConfig.v2nMainSwitch = true - FunctionBuildConfig.isNewV2NData = true - FunctionBuildConfig.v2nMainSwitch = true runCatching { val map = HashMap().also { it["f1"] = FunctionBuildConfig.v2nMainSwitch 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 1422073312..34101dd922 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 @@ -6,36 +6,26 @@ import android.os.Message import android.text.TextUtils import android.util.Log import androidx.core.util.Pair -import com.google.gson.JsonArray -import com.google.gson.JsonObject import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.enums.CommunicationType import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.EventTypeEnumNew -import com.mogo.eagle.core.data.enums.TrafficTypeEnum -import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP import com.mogo.eagle.core.data.map.entity.MarkerExploreWay import com.mogo.eagle.core.data.map.entity.MarkerLocation import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType.V2X import com.mogo.eagle.core.data.msgbox.V2XMsg -import com.mogo.eagle.core.function.angle.scenes.Default -import com.mogo.eagle.core.function.angle.scenes.RoadEvent import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.api.autopilot.IMoGoV2nNioEventListener -import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener -import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N -import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -144,7 +134,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener { it.location = e.location it.polygon = polygon } - }), true, isDrawRoadLine(poiType) + }, isUseGps = true), true, isDrawRoadLine(poiType) ) val distance = CoordinateUtils.calculateLineDistance( @@ -168,6 +158,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener { ) ) if (polygon.isNotEmpty()) { + val decision = V2NUtils.computeOccupyLanesInfo(Triple(car.longitude, car.latitude, car.heading.toFloat()), Triple(itx.longitude, itx.latitude, itx.heading.toFloat()), polygon.map { kotlin.Pair(it.first, it.second) }) if (decision != null) { val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) @@ -330,12 +321,10 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } Logger.d(TAG, "cameraIp: $cameraIp, heading:$heading, uuid: $uuid") val newEventId = "other_retrograde_vehicle_${event.eventId}" + val isUseGps = event.gnssType != 0 + val eventLocation = if (isUseGps) arrayOf(event.longitude, event.latitude) else CoordinateTransform.GCJ02ToWGS84(event.longitude, event.latitude) + val carLocation = if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() AiRoadMarker.aiMakers.getOrPut(newEventId) { - val eventLocation = when (event.gnssType) { - 0 -> CoordinateTransform.GCJ02ToWGS84(event.longitude, event.latitude) - else -> arrayOf(event.longitude, event.latitude) - } - val carLocation = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, eventLocation[0], eventLocation[1]) if (distance > 150) { Logger.i(TAG, "other_retrograde_vehicle --> distance > 150") @@ -352,11 +341,11 @@ internal object V2NIdentifyDrawer: IEventDismissListener { isDriver, String.format(EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt()), cameraIp.toString(), - event.longitude, - event.latitude) + eventLocation[0], + eventLocation[1]) AiRoadMarker() }.also { - it.marker(Marker(newEventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType, event.longitude, event.latitude, 0.0), drawMarker = true, false, isHighFrequency = true) + it.marker(Marker(newEventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType, eventLocation[0], eventLocation[1], heading, isUseGps = isUseGps), drawMarker = true, false, isHighFrequency = true) }.receive() } else if (msg.what == MSG_WHAT_DRAW_GREEN_WAVE) { val data = msg.obj as? V2nCrossSpeed ?: return@Callback true @@ -406,17 +395,19 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } } Logger.d(TAG, "cameraIp: $cameraIp, heading:$heading, uuid: $uuid") + val isUseGps = data.gnssType != 0 + val eventLocation = if (isUseGps) arrayOf(data.longitude, data.latitude) else CoordinateTransform.GCJ02ToWGS84(data.longitude, data.latitude) + val carLocation = if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() + val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, eventLocation[0], eventLocation[1]) AiRoadMarker.aiMakers.getOrPut(data.eventId) { Logger.i(TAG, "people cross -- 2 --") - val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) - val carLocation = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() - val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, data.longitude, data.latitude) if (distance > 150) { Logger.i(TAG, "people cross --> distance > 150") V2XBizTrace.onAck(TAG, mapOf("people cross" to "distance > 150"), true) return@Callback true } Logger.i(TAG, "people cross -- 3 --") + val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) // 弹事件框 CallerRoadV2NEventWindowListenerManager.showLiveVideo( data.eventId, @@ -426,12 +417,12 @@ internal object V2NIdentifyDrawer: IEventDismissListener { isDriver, String.format(EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt()), cameraIp.toString(), - data.longitude, - data.latitude) + eventLocation[0], + eventLocation[1]) AiRoadMarker() }.also { Logger.i(TAG, "people cross -- 4 --") - it.marker(Marker(data.eventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, data.longitude, data.latitude, heading), drawMarker = true, false, isHighFrequency = true) + it.marker(Marker(data.eventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, eventLocation[0], eventLocation[1], heading, isUseGps = isUseGps), drawMarker = true, false, isHighFrequency = true) }.receive() } 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 c5a8a3a94b..342c9ec359 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 @@ -107,7 +107,7 @@ class AiRoadMarker { val builder = getOrPutPointOptionBuilder(markerId, V2XConst.V2X_MARKER_OWNER, MAP_MARKER) builder .set3DMode(true) - .isUseGps(true) + .isUseGps(marker.isUseGps) .icon3DRes(EventTypeEnumNew.getMarker3DRes(marker.poiType)) .anchorColor("#D65D5AFF") .controlAngle(true) @@ -122,7 +122,7 @@ class AiRoadMarker { if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType) { distance = 100 } - val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = distance) + val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, if (marker.isUseGps) 1 else 0, elapsedDistance = distance) wrapper.onRemoved = { builders.remove(markerId) markerIds.remove(p.id) @@ -153,7 +153,7 @@ class AiRoadMarker { if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) { elapsedDuration = TimeUnit.SECONDS.toMillis(3) } - val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = elapsedDistance, elapsedDuration = elapsedDuration) + val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, if (marker.isUseGps) 1 else 0, elapsedDistance = elapsedDistance, elapsedDuration = elapsedDuration) if (drawMarker) { marker.entity?.apply { roadMarker.drawMarkers(this, wrapper) } } @@ -371,6 +371,7 @@ class AiRoadMarker { val polygon: List>? = null, var farthestPoint: Pair? = null, var entity: V2XRoadEventEntity? = null, + var isUseGps: Boolean = false ) { override fun equals(other: Any?): Boolean { diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java index 2353f53d63..b6de8c06b4 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java @@ -47,7 +47,7 @@ public class V2XRoadEventMarker implements IV2XMarker { List> polygons = noveltyInfo.getPolygon(); if (gpsLocation != null && polygons != null) { MarkerLocation location = noveltyInfo.getLocation(); - AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity); + AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity, false); AiRoadMarker aiMarker = new AiRoadMarker(); aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType()), false); AiRoadMarker.aiMakers.put(noveltyInfo.getInfoId(), aiMarker); 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 2d58dfb4d9..b277f967e6 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 @@ -16,6 +16,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.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager @@ -37,7 +38,9 @@ import io.netty.channel.Channel import kotlinx.coroutines.delay import kotlinx.coroutines.launch import mogo.telematics.pad.MessagePad +import mogo.telematics.pad.MessagePad.TrackedObject import java.nio.charset.Charset +import java.util.Collections class TeleMsgHandler : IMsgHandler { @@ -103,6 +106,22 @@ class TeleMsgHandler : IMsgHandler { } return } + if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GONG) { + runCatching { + Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 1 ---") + CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body))) + Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 2 ---") + } + return + } + if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GU) { + runCatching { + Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 1 ---") + CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body))) + Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 2 ---") + } + return + } if (it.protocolType == TelematicConstant.V2N_NEW_LINK_SWITCH) { try { Log.d(TAG, "乘客屏收到司机屏转发的新链路开关 --- 1 ---") diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt index 8d5d056f79..d9491b76a2 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt @@ -19,10 +19,16 @@ class TelematicConstant { const val V2N_NEW_LINK_SWITCH = 202 // FunctionBuildConfig#v2nMainSwitch & FunctionBuildConfig#isNewV2NData + // -------------------- For Android Unit Test -----BEGIN------------ const val V2N_AI_ROAD_PEOPLE_CROSS = 203 const val V2N_AI_ROAD_GREEN_WAVE = 204 const val V2N_AI_ROAD_OTHER_RETROGRADE_VEHICLE = 205 + + const val V2N_AI_ROAD_SHI_GONG = 206 + + const val V2N_AI_ROAD_SHI_GU = 207 + // -------------------- For Android Unit Test ------ END ------------ } } \ No newline at end of file