[6.5.0][道路事件] 道路施工和道路事件添加根据source字段区分来源(nde或感知)

This commit is contained in:
renwj
2024-07-16 18:05:35 +08:00
parent 4614337214
commit f486693e73
2 changed files with 12 additions and 107 deletions

View File

@@ -81,7 +81,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGu --- 1 ---")
}
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val filtered = events.filterIsInstance<TrackedObject>().filter { itx ->
var filtered = events.filterIsInstance<TrackedObject>().filter { itx ->
DrivingDirectionUtils.getDegreeOfCar2Poi(
car.longitude,
car.latitude,
@@ -104,8 +104,17 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
} else {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGu --- 2 ---")
}
val data = filtered
filtered = filtered.filter { itx ->
val trackedSourceList = itx.trackedSourceList
trackedSourceList.isNotEmpty() && trackedSourceList.find { it.source != 1 } != null
}
if (filtered.isEmpty()) {
V2XBizTrace.onAck(data, mapOf("shiGong-shiGu-filter-2" to "数据来源不对"), true)
return@Callback true
}
filtered.forEach { itx ->
val id = itx.uuid.toString()
val id = itx.v2XUuid.ifEmpty { itx.uuid.toString() }
V2XBizTrace.onAck(itx, "filtered -> ${itx.type}")
Log.d("V2NIdentifyDrawer", "---callback --- id: $id ---")
AiRoadMarker.aiMakers.getOrPut(id) {
@@ -197,110 +206,6 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
} else if (msg.what == MSG_WHAT_DRAW_YONGDU) {
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 1 ---")
/* val events = msg.obj as? List<*>
if (events == null || events.isEmpty()) {
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 1 filter is empty ---")
V2XBizTrace.onAck(TAG, mapOf("yongDu" to ""), true)
return@Callback true
}
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val filtered = events.filterIsInstance<RTEData_PB>().filter { itx ->
val eventLon =
itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
?: 0.0
val eventLat =
itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 }
?: 0.0
DrivingDirectionUtils.getDegreeOfCar2Poi(
car.longitude,
car.latitude,
eventLon,
eventLat,
car.heading.toInt()
) < 90 && CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, eventLon, eventLat) <= 300
}
if (filtered.isEmpty()) {
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 2 filter is empty ---")
V2XBizTrace.onAck(TAG, mapOf("yongDu-filter" to ""), true)
return@Callback true
}
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 2 ---")
filtered.forEach { itx ->
val id = itx.rteId.toString()
val lon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
?: 0.0
val lat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 }
?: 0.0
Log.d("V2NIdentifyDrawer", "---callback -- id: $id---")
AiRoadMarker.aiMakers.getOrPut(id) {
AiRoadMarker().apply {
val poiType = getPoiType(itx.eventType).poiType
marker(Marker(id, poiType, lon, lat, car.heading, null, null,
V2XRoadEventEntity().also { e ->
e.poiType = poiType
e.location = MarkerLocation().also { l ->
val p = CoordinateTransform.WGS84ToGCJ02(lon, lat)
l.lon = p[0]
l.lat = p[1]
l.angle = car.heading
}
e.noveltyInfo = MarkerExploreWay().also {
it.poiType = poiType
it.location = e.location
it.polygon = emptyList()
}
}), true, isDrawRoadLine(poiType)
)
val distance = CoordinateUtils.calculateLineDistance(
lon,
lat,
car.longitude,
car.latitude
)
val alertContent = getAlertContent(poiType, distance.toDouble())
val ttsContent = getTtsContent(poiType, distance.toDouble())
V2XBizTrace.onAck(TAG, "绘制poi事件:$poiType")
saveMsgBox(
MsgBoxBean(
V2X,
V2XMsg(
poiType,
alertContent,
ttsContent,
CommunicationType.V2N.name
)
)
)
CallerHmiManager.warningV2X(
poiType,
alertContent,
ttsContent,
object : IMoGoWarningStatusListener {
override fun onShow() {
super.onShow()
runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) }
CallerVisualAngleManager.changeScene(RoadEvent(2, SECONDS))
}
override fun onDismiss() {
super.onDismiss()
runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) }
CallerVisualAngleManager.changeScene(Default())
}
},
ALERT_WARNING_TOP,
10000,
false
)
//消息埋点
V2XEventAnalyticsManager.triggerV2XEvent(
poiType, alertContent, ttsContent,
DataSourceType.AICLOUD, CommunicationType.V2N
)
}
}.receive()
}*/
} else if (msg.what == MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE) {
val event = msg.obj as? MessagePad.Event
if (event == null) {

View File

@@ -115,7 +115,7 @@ class AiRoadMarker {
.longitude(marker.poi_lon)
.latitude(marker.poi_lat)
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType) {
builder.anchorColor("#FFE1BA9A")
builder.anchorColor("#D6E1BA9A")
}
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdatePoint(builder.build())?.let { p ->
if (!markerIds.contains(markerId)) {