[6.5.0][道路事件] 修复qa发现的问题
This commit is contained in:
@@ -6,6 +6,8 @@ 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
|
||||
@@ -197,7 +199,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
}
|
||||
val alert = sb.toString()
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo("${itx.longitude}-${itx.latitude}", itx.systemTime.toLong(), EventTypeEnumNew.getUpdateIconRes(poiType), alert, isDriver, itx.cameraIp, itx.longitude, itx.latitude)
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo("${itx.longitude}-${itx.latitude}", itx.detectStartTime, EventTypeEnumNew.getUpdateIconRes(poiType), alert, isDriver, itx.cameraIp, itx.longitude, itx.latitude)
|
||||
}
|
||||
}
|
||||
//消息埋点
|
||||
@@ -210,7 +212,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
} else if (msg.what == MSG_WHAT_DRAW_YONGDU) {
|
||||
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 1 ---")
|
||||
val events = msg.obj as? List<*>
|
||||
/* 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)
|
||||
@@ -313,7 +315,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
)
|
||||
}
|
||||
}.receive()
|
||||
}
|
||||
}*/
|
||||
} else if (msg.what == MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE) {
|
||||
val event = msg.obj as? MessagePad.Event
|
||||
if (event == null) {
|
||||
@@ -321,6 +323,24 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
V2XBizTrace.onAck(TAG, mapOf("other_retrograde_vehicle" to "event == null"), true)
|
||||
return@Callback true
|
||||
}
|
||||
val body = runCatching { GsonUtils.fromJson(event.exts, Map::class.java) }.getOrNull()
|
||||
val cameraIp = body?.get("cameraIp") as? String ?: ""
|
||||
val array = (body?.get("eventExtUnits") as? JsonArray)
|
||||
var heading = 0.0
|
||||
var uuid = ""
|
||||
if (array != null && array.size() > 0) {
|
||||
for (e in array) {
|
||||
if (e is JsonObject) {
|
||||
if (e.has("heading")) {
|
||||
heading = runCatching { e.asDouble }.getOrNull() ?: 0.0
|
||||
}
|
||||
if (e.has("uuid")) {
|
||||
uuid = runCatching { e.asString }.getOrNull() ?: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "cameraIp: $cameraIp, heading:$heading, uuid: $uuid")
|
||||
val newEventId = "other_retrograde_vehicle_${event.eventId}"
|
||||
AiRoadMarker.aiMakers.getOrPut(newEventId) {
|
||||
val eventLocation = when (event.gnssType) {
|
||||
@@ -335,8 +355,6 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
return@Callback true
|
||||
}
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
val cameraIp = if(TextUtils.isEmpty(event.exts)) ""
|
||||
else (GsonUtils.fromJson(event.exts, Map::class.java)["cameraIp"])?:""
|
||||
// 弹事件框
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo(
|
||||
newEventId,
|
||||
@@ -387,6 +405,24 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
} else if (msg.what == MSG_WHAT_DRAW_PEOPLE_CROSS) {
|
||||
Logger.i(TAG, "people cross -- 1 --")
|
||||
val data = msg.obj as? MessagePad.Event ?: return@Callback true
|
||||
val body = runCatching { GsonUtils.fromJson(data.exts, Map::class.java) }.getOrNull()
|
||||
val cameraIp = body?.get("cameraIp") as? String ?: ""
|
||||
val array = (body?.get("eventExtUnits") as? JsonArray)
|
||||
var heading = 0.0
|
||||
var uuid = ""
|
||||
if (array != null && array.size() > 0) {
|
||||
for (e in array) {
|
||||
if (e is JsonObject) {
|
||||
if (e.has("heading")) {
|
||||
heading = runCatching { e.asDouble }.getOrNull() ?: 0.0
|
||||
}
|
||||
if (e.has("uuid")) {
|
||||
uuid = runCatching { e.asString }.getOrNull() ?: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "cameraIp: $cameraIp, heading:$heading, uuid: $uuid")
|
||||
AiRoadMarker.aiMakers.getOrPut(data.eventId) {
|
||||
Logger.i(TAG, "people cross -- 2 --")
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
@@ -398,22 +434,19 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
return@Callback true
|
||||
}
|
||||
Logger.i(TAG, "people cross -- 3 --")
|
||||
val cameraIp = if(TextUtils.isEmpty(data.exts)) ""
|
||||
else (GsonUtils.fromJson(data.exts, Map::class.java)["cameraIp"])?:""
|
||||
// 弹事件框
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo(
|
||||
data.eventId,
|
||||
data.timestamp,
|
||||
EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType),
|
||||
String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt()),
|
||||
isDriver,
|
||||
cameraIp.toString(),
|
||||
isDriver, cameraIp,
|
||||
data.longitude,
|
||||
data.latitude)
|
||||
AiRoadMarker()
|
||||
}.also {
|
||||
Logger.i(TAG, "people cross -- 4 --")
|
||||
it.marker(Marker(data.eventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, data.longitude, data.latitude, 0.0), drawMarker = true, false, isHighFrequency = true)
|
||||
it.marker(Marker(data.eventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, data.longitude, data.latitude, heading), drawMarker = true, false, isHighFrequency = true)
|
||||
}.receive()
|
||||
}
|
||||
true
|
||||
@@ -457,7 +490,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
var best = Int.MIN_VALUE
|
||||
var delta = Int.MAX_VALUE
|
||||
for (lane in freeLanes) {
|
||||
val abs = kotlin.math.abs(lane.id - laneId)
|
||||
val abs = abs(lane.id - laneId)
|
||||
if (abs < delta && lane.id != laneId) {
|
||||
best = lane.id
|
||||
delta = abs
|
||||
@@ -488,7 +521,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
private fun computeCrossCountBetween(start: Triple<Double, Double, Double>, end: kotlin.Pair<Double, Double>): 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_end
|
||||
var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
|
||||
val angle = start.third
|
||||
var count = 1
|
||||
for (p in points) {
|
||||
@@ -605,6 +638,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
private fun drawPeopleCross(event: MessagePad.Event) {
|
||||
Log.d("V2NIdentifyDrawer", "---drawPeopleCross---: $event, [${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}]")
|
||||
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
handler.removeMessages(MSG_WHAT_DRAW_PEOPLE_CROSS)
|
||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_PEOPLE_CROSS, event))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
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.utilcode.mogo.logger.Logger
|
||||
@@ -101,6 +102,7 @@ class AiRoadMarker {
|
||||
fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false, isHighFrequency:Boolean = false) {
|
||||
val markerId = marker.id
|
||||
if (isHighFrequency && drawMarker) {
|
||||
this.marker.set(marker)
|
||||
Logger.d(TAG, "marker --->poiType: $marker, ${EventTypeEnumNew.getMarker3DRes(marker.poiType)}")
|
||||
val builder = getOrPutPointOptionBuilder(markerId, V2XConst.V2X_MARKER_OWNER, MAP_MARKER)
|
||||
builder
|
||||
@@ -108,6 +110,9 @@ class AiRoadMarker {
|
||||
.isUseGps(true)
|
||||
.icon3DRes(EventTypeEnumNew.getMarker3DRes(marker.poiType))
|
||||
.anchorColor("#D65D5AFF")
|
||||
.controlAngle(true)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.rotate(marker.poi_angle.toFloat())
|
||||
.longitude(marker.poi_lon)
|
||||
.latitude(marker.poi_lat)
|
||||
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdatePoint(builder.build())?.let { p ->
|
||||
@@ -119,10 +124,13 @@ class AiRoadMarker {
|
||||
}
|
||||
val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = distance)
|
||||
wrapper.onRemoved = {
|
||||
Logger.d(TAG, "222 -> marker --->poiType: $marker, ${EventTypeEnumNew.getMarker3DRes(marker.poiType)}")
|
||||
CallerRoadV2NEventWindowListenerManager.dismiss(markerId)
|
||||
builders.remove(markerId)
|
||||
markerIds.remove(p.id)
|
||||
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
|
||||
CallerHmiManager.dismissGreenWave()
|
||||
} else {
|
||||
CallerRoadV2NEventWindowListenerManager.dismiss(marker.id)
|
||||
}
|
||||
}
|
||||
wrapper.addPoint(p)
|
||||
MarkerRemoveManager.addMarker(wrapper)
|
||||
@@ -222,22 +230,7 @@ class AiRoadMarker {
|
||||
V2XBizTrace.onAck("$TAG -marker-4-l2:", l2)
|
||||
val points = LinkedList<MogoLatLng>()
|
||||
if (l2.points.isNotEmpty()) {
|
||||
points.addAll(l2.points.reversed()/*.filter {
|
||||
val location = V2XEventManager.getFirstLocationInCross()
|
||||
Log.d(TAG, "l2: location -> $location")
|
||||
if (location != null) {
|
||||
val carLocation = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(carLocation.longitude, carLocation.latitude, location.longitude, location.latitude, carLocation.heading) > 90) {
|
||||
//处理同一个路口不同车道调头,这种极端情况
|
||||
true
|
||||
} else {
|
||||
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, it.longitude, it.latitude, location.heading)
|
||||
angle <= 90
|
||||
}
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}.*/.map {
|
||||
points.addAll(l2.points.reversed().map {
|
||||
MogoLatLng(it.latitude, it.longitude)
|
||||
})
|
||||
}
|
||||
@@ -330,7 +323,11 @@ class AiRoadMarker {
|
||||
roadMarker.removeMarkers()
|
||||
handler.removeCallbacks(checkExpiredTask)
|
||||
aiMakers.remove(marker.id)
|
||||
CallerRoadV2NEventWindowListenerManager.dismiss("${marker.poi_lon}-${marker.poi_lat}")
|
||||
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
|
||||
CallerHmiManager.dismissGreenWave()
|
||||
} else {
|
||||
CallerRoadV2NEventWindowListenerManager.dismiss(marker.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +370,7 @@ class AiRoadMarker {
|
||||
val poi_angle: Double,
|
||||
val polygon: List<Pair<Double, Double>>? = null,
|
||||
var farthestPoint: Pair<Double, Double>? = null,
|
||||
var entity: V2XRoadEventEntity? = null
|
||||
var entity: V2XRoadEventEntity? = null,
|
||||
) {
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user