[6.10.0][Feat]车龙事件新增推荐车道信息
This commit is contained in:
@@ -66,7 +66,7 @@ import kotlin.math.abs
|
||||
/**
|
||||
* V2N上车相关事件绘制
|
||||
*/
|
||||
internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
internal object V2NIdentifyDrawer : IEventDismissListener {
|
||||
|
||||
private const val TAG = "V2NIdentifyDataSubscriber"
|
||||
|
||||
@@ -94,7 +94,12 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
itx.longitude,
|
||||
itx.latitude,
|
||||
car.heading.toInt()
|
||||
) < 90 && CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, itx.longitude, itx.latitude) <= 300
|
||||
) < 90 && CoordinateUtils.calculateLineDistance(
|
||||
car.longitude,
|
||||
car.latitude,
|
||||
itx.longitude,
|
||||
itx.latitude
|
||||
) <= 300
|
||||
}
|
||||
if (filtered.isEmpty()) {
|
||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu-filter" to ""), true)
|
||||
@@ -112,36 +117,43 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
// }
|
||||
// Log.d("V2NIdentifyDrawer", "--- 不在路口了 ---")
|
||||
if (msg.what == MSG_WHAT_DRAW_SHIGONE) {
|
||||
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD_CONSTRUCTION)
|
||||
CallerServicesEventManager.updateServicesNum(
|
||||
CallerServicesEventManager.ServiceType.ROAD_CONSTRUCTION
|
||||
)
|
||||
} else {
|
||||
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD_ACCIDENT)
|
||||
CallerServicesEventManager.updateServicesNum(
|
||||
CallerServicesEventManager.ServiceType.ROAD_ACCIDENT
|
||||
)
|
||||
}
|
||||
val poiType = getPoiType(itx.type).poiType
|
||||
val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) }
|
||||
marker(Marker(id,
|
||||
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
|
||||
}
|
||||
}, isUseGps = true), true, isDrawRoadLine(poiType)
|
||||
val polygon =
|
||||
itx.polygonList.map { Pair.create(it.longitude, it.latitude) }
|
||||
marker(
|
||||
Marker(id,
|
||||
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
|
||||
}
|
||||
}, isUseGps = true
|
||||
), true, isDrawRoadLine(poiType)
|
||||
)
|
||||
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
@@ -150,21 +162,36 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
car.longitude,
|
||||
car.latitude
|
||||
)
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
val isDriver =
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
if (!isDriver) {
|
||||
runCatching {
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), START)
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(
|
||||
V2N(
|
||||
EventTypeEnumNew.getEnumType(
|
||||
poiType
|
||||
)
|
||||
), START
|
||||
)
|
||||
}
|
||||
scope.launch {
|
||||
delay(5000)
|
||||
runCatching {
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), STOP)
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(
|
||||
V2N(
|
||||
EventTypeEnumNew.getEnumType(poiType)
|
||||
), STOP
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
val contentType = if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "道路施工" else "道路事故"
|
||||
val contentType =
|
||||
if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "道路施工" else "道路事故"
|
||||
val content = "前方${distance.toInt()}米有$contentType"
|
||||
val tts = "${SkinResources.getInstance().getString(R.string.operation_platform_name)}发现前方$contentType, 提醒您注意行人及来车"
|
||||
val tts = "${
|
||||
SkinResources.getInstance()
|
||||
.getString(R.string.operation_platform_name)
|
||||
}发现前方$contentType, 提醒您注意行人及来车"
|
||||
V2XBizTrace.onAck(TAG, "绘制poi事件:$poiType")
|
||||
saveMsgBox(
|
||||
MsgBoxBean(
|
||||
@@ -177,7 +204,16 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
)
|
||||
)
|
||||
)
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo(id, itx.detectStartTime.takeIf { it > 0 } ?: System.currentTimeMillis(), EventTypeEnumNew.getUpdateIconRes(poiType), content, isDriver, tts, itx.cameraIp, itx.longitude, itx.latitude)
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo(
|
||||
id,
|
||||
itx.detectStartTime.takeIf { it > 0 } ?: System.currentTimeMillis(),
|
||||
EventTypeEnumNew.getUpdateIconRes(poiType),
|
||||
content,
|
||||
isDriver,
|
||||
tts,
|
||||
itx.cameraIp,
|
||||
itx.longitude,
|
||||
itx.latitude)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
poiType, content, tts,
|
||||
@@ -193,7 +229,8 @@ 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, Extras::class.java) }.getOrNull()
|
||||
val body =
|
||||
runCatching { GsonUtils.fromJson(event.exts, Extras::class.java) }.getOrNull()
|
||||
val cameraIp = body?.cameraIp
|
||||
val array = body?.eventExtUnits
|
||||
var heading = 0.0
|
||||
@@ -206,42 +243,77 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
val newEventId = "other_retrograde_vehicle_${event.eventId}"
|
||||
val isUseGps = event.gnssType != 0
|
||||
V2XBizTrace.onAck(TAG, mapOf("cameraIp" to cameraIp, "heading" to heading, "uuid" to uuid, "isUseGps" to isUseGps, "newEventId" to newEventId), true)
|
||||
V2XBizTrace.onAck(
|
||||
TAG,
|
||||
mapOf(
|
||||
"cameraIp" to cameraIp,
|
||||
"heading" to heading,
|
||||
"uuid" to uuid,
|
||||
"isUseGps" to isUseGps,
|
||||
"newEventId" to newEventId
|
||||
),
|
||||
true
|
||||
)
|
||||
val eventLocation = arrayOf(event.longitude, event.latitude)
|
||||
val carLocation = if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val carLocation =
|
||||
if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
carLocation.longitude,
|
||||
carLocation.latitude,
|
||||
eventLocation[0],
|
||||
eventLocation[1],
|
||||
carLocation.heading.toInt()
|
||||
) >= 90) {
|
||||
V2XBizTrace.onAck(event, "other-retrograde-vehicle" to "事件在车的后面,不触发", true)
|
||||
) >= 90
|
||||
) {
|
||||
V2XBizTrace.onAck(
|
||||
event,
|
||||
"other-retrograde-vehicle" to "事件在车的后面,不触发",
|
||||
true
|
||||
)
|
||||
return@Callback true
|
||||
}
|
||||
AiRoadMarker.aiMakers.getOrPut(newEventId) {
|
||||
val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, eventLocation[0], eventLocation[1])
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
carLocation.longitude,
|
||||
carLocation.latitude,
|
||||
eventLocation[0],
|
||||
eventLocation[1]
|
||||
)
|
||||
if (distance > 150) {
|
||||
Logger.i(TAG, "other_retrograde_vehicle --> distance > 150")
|
||||
V2XBizTrace.onAck(TAG, mapOf("other_retrograde_vehicle" to "distance > 150"), true)
|
||||
V2XBizTrace.onAck(
|
||||
TAG,
|
||||
mapOf("other_retrograde_vehicle" to "distance > 150"),
|
||||
true
|
||||
)
|
||||
return@Callback true
|
||||
}
|
||||
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.RETROGRADE_EVENT)
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
runCatching {
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE), START)
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(
|
||||
V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE),
|
||||
START
|
||||
)
|
||||
}
|
||||
scope.launch {
|
||||
delay(5000)
|
||||
runCatching {
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE), STOP)
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(
|
||||
V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE),
|
||||
STOP
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 弹事件框
|
||||
val alertContent = String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt())
|
||||
val alertTts = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType)
|
||||
val alertContent = String.format(
|
||||
EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType),
|
||||
distance.toInt()
|
||||
)
|
||||
val alertTts =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType)
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo(
|
||||
newEventId,
|
||||
event.timestamp,
|
||||
@@ -251,15 +323,28 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
alertTts,
|
||||
cameraIp.toString(),
|
||||
eventLocation[0],
|
||||
eventLocation[1])
|
||||
eventLocation[1]
|
||||
)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType, alertContent, alertTts,
|
||||
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType,
|
||||
alertContent,
|
||||
alertTts,
|
||||
DataSourceType.AICLOUD,
|
||||
CommunicationType.V2N
|
||||
)
|
||||
AiRoadMarker()
|
||||
}.also {
|
||||
it.marker(Marker(newEventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType, eventLocation[0], eventLocation[1], heading, isUseGps = isUseGps), 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
|
||||
@@ -272,7 +357,8 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
destX,
|
||||
destY,
|
||||
location.heading.toInt()
|
||||
) >= 90) {
|
||||
) >= 90
|
||||
) {
|
||||
V2XBizTrace.onAck(data, "green-wave-event" to "事件在车的后面,不触发", true)
|
||||
return@Callback true
|
||||
}
|
||||
@@ -283,7 +369,18 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
val current = abs(location.gnssSpeed).toInt()
|
||||
val min = abs(data.speedStraightMin).toInt()
|
||||
val max = abs(data.speedStraightMax).toInt()
|
||||
marker(Marker(id, EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType, destX, destY, 0.0, null, null, null), drawMarker = false, false)
|
||||
marker(
|
||||
Marker(
|
||||
id,
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
|
||||
destX,
|
||||
destY,
|
||||
0.0,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
), drawMarker = false, false
|
||||
)
|
||||
var alertTts = ""
|
||||
var alertContent = ""
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
@@ -291,11 +388,21 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
val speakText = StringBuilder("保持当前车速即可通过路口,好丝滑!")
|
||||
if (current < min) {
|
||||
speakText.setLength(0)
|
||||
speakText.append("${SkinResources.getInstance().getString(R.string.operation_platform_name)}推荐您提升车速至${min}千米每小时, 当前车速${current}千米每小时")
|
||||
speakText.append(
|
||||
"${
|
||||
SkinResources.getInstance()
|
||||
.getString(R.string.operation_platform_name)
|
||||
}推荐您提升车速至${min}千米每小时, 当前车速${current}千米每小时"
|
||||
)
|
||||
}
|
||||
if (current > max) {
|
||||
speakText.setLength(0)
|
||||
speakText.append("${SkinResources.getInstance().getString(R.string.operation_platform_name)}推荐您降低车速至${max}千米每小时, 当前车速${current}千米每小时")
|
||||
speakText.append(
|
||||
"${
|
||||
SkinResources.getInstance()
|
||||
.getString(R.string.operation_platform_name)
|
||||
}推荐您降低车速至${max}千米每小时, 当前车速${current}千米每小时"
|
||||
)
|
||||
}
|
||||
val tts = speakText.toString()
|
||||
alertTts = tts
|
||||
@@ -305,10 +412,23 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType, alertContent, alertTts,
|
||||
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
|
||||
alertContent,
|
||||
alertTts,
|
||||
DataSourceType.AICLOUD,
|
||||
CommunicationType.V2N
|
||||
)
|
||||
CallerHmiManager.showGreenWave(
|
||||
min,
|
||||
max,
|
||||
computeCrossCountBetween(
|
||||
Triple(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
location.heading
|
||||
), kotlin.Pair(destX, destY)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.showGreenWave(min, max, computeCrossCountBetween(Triple(location.longitude, location.latitude, location.heading), kotlin.Pair(destX, destY)))
|
||||
} finally {
|
||||
receive()
|
||||
}
|
||||
@@ -332,15 +452,22 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
val isUseGps = data.gnssType != 0
|
||||
Logger.i(TAG, "isUseGps --> $isUseGps")
|
||||
val eventLocation = arrayOf(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])
|
||||
val carLocation =
|
||||
if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
carLocation.longitude,
|
||||
carLocation.latitude,
|
||||
eventLocation[0],
|
||||
eventLocation[1]
|
||||
)
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
carLocation.longitude,
|
||||
carLocation.latitude,
|
||||
eventLocation[0],
|
||||
eventLocation[1],
|
||||
carLocation.heading.toInt()
|
||||
) >= 90) {
|
||||
) >= 90
|
||||
) {
|
||||
V2XBizTrace.onAck(data, "people-cross" to "事件在车的后面,不触发", true)
|
||||
return@Callback true
|
||||
}
|
||||
@@ -356,18 +483,28 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
runCatching {
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS), START)
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(
|
||||
V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS),
|
||||
START
|
||||
)
|
||||
}
|
||||
scope.launch {
|
||||
delay(5000)
|
||||
runCatching {
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS), STOP)
|
||||
CallerHmiManager.notifyXiaoZhiStatusChanged(
|
||||
V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS),
|
||||
STOP
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 弹事件框
|
||||
val alertContent = String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt())
|
||||
val alertTts = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType)
|
||||
val alertContent = String.format(
|
||||
EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType),
|
||||
distance.toInt()
|
||||
)
|
||||
val alertTts =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType)
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo(
|
||||
data.eventId,
|
||||
data.timestamp,
|
||||
@@ -377,16 +514,26 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
alertTts,
|
||||
cameraIp.toString(),
|
||||
eventLocation[0],
|
||||
eventLocation[1])
|
||||
eventLocation[1]
|
||||
)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, alertContent, alertTts,
|
||||
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||
)
|
||||
AiRoadMarker()
|
||||
AiRoadMarker()
|
||||
}.also {
|
||||
Logger.i(TAG, "people cross -- 4 --")
|
||||
it.marker(Marker(data.eventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, eventLocation[0], eventLocation[1], heading, isUseGps = isUseGps), 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
|
||||
@@ -418,7 +565,10 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
// }
|
||||
// }
|
||||
|
||||
private fun computeCrossCountBetween(start: Triple<Double, Double, Double>, end: kotlin.Pair<Double, Double>): Int {
|
||||
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
|
||||
@@ -472,28 +622,45 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
|
||||
super.onAutopilotIdentifyDataUpdate(trafficData)
|
||||
//source: 1 -> 感知数据; 2 -> 融合数据
|
||||
val shiGong = trafficData?.filter { itx -> (itx.type == 501 || itx.type == 502) && itx.trackedSourceList.find { it.source != 1 } != null }
|
||||
val shiGong =
|
||||
trafficData?.filter { itx -> (itx.type == 501 || itx.type == 502) && itx.trackedSourceList.find { it.source != 1 } != null }
|
||||
if (!shiGong.isNullOrEmpty()) {
|
||||
drawShiGong(shiGong)
|
||||
}
|
||||
val shiGu = trafficData?.filter { itx -> itx.type == 13 && itx.trackedSourceList.find { it.source != 1 } != null }
|
||||
val shiGu =
|
||||
trafficData?.filter { itx -> itx.type == 13 && itx.trackedSourceList.find { it.source != 1 } != null }
|
||||
if (!shiGu.isNullOrEmpty()) {
|
||||
drawShiGu(shiGu)
|
||||
}
|
||||
val chelong = trafficData?.find { itx ->
|
||||
itx.addAttribute == MessagePad.AdditionalAttribute.ATTR_ROAD_CONGESTION
|
||||
var hasCheLong = false
|
||||
val roadMsgList = ArrayList<NDEMsg.RoadMsg>()
|
||||
trafficData?.forEach { obj ->
|
||||
if (obj.type == 707) {
|
||||
if (obj.polygonCount > 1) {
|
||||
hasCheLong = true
|
||||
}
|
||||
roadMsgList.add(
|
||||
NDEMsg.RoadMsg(
|
||||
obj.arrowType, laneNum = obj.laneNum,
|
||||
isRecommend = obj.suggestedLanes, isCheLong = obj.polygonCount > 1
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (chelong != null) {
|
||||
if (hasCheLong) {
|
||||
saveMsgBox(MsgBoxBean(
|
||||
MsgBoxType.NDE,
|
||||
NDEMsg(
|
||||
"","路口车龙","前方路口有车龙"
|
||||
)
|
||||
"", "路口车龙", "前方路口有车龙"
|
||||
).also {
|
||||
it.setRoadList(roadMsgList)
|
||||
}
|
||||
))
|
||||
// 司机屏才TTS
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoiceWithLevel("蘑菇发现前方路口有车龙", AIAssist.NEW_LEVEL_2)
|
||||
AIAssist.getInstance(Utils.getApp())
|
||||
.speakTTSVoiceWithLevel("蘑菇发现前方路口有车龙", AIAssist.NEW_LEVEL_2)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,7 +704,13 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
private fun drawOtherRetrogradeVehicle(event: MessagePad.Event) {
|
||||
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
|
||||
handler.removeMessages(MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE)
|
||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE, event))
|
||||
handler.sendMessage(
|
||||
Message.obtain(
|
||||
handler,
|
||||
MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE,
|
||||
event
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,20 +736,20 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
|
||||
override fun onV2nNioCrossoverEvent(event: MessagePad.Event) {
|
||||
super.onV2nNioCrossoverEvent(event)
|
||||
V2XBizTrace.onAck(event,"onV2nNioCrossoverEvent", true)
|
||||
V2XBizTrace.onAck(event, "onV2nNioCrossoverEvent", true)
|
||||
drawPeopleCross(event)
|
||||
}
|
||||
|
||||
override fun onV2nNioGreenWavePassageEvent(crossSpeed: V2nCrossSpeed) {
|
||||
super.onV2nNioGreenWavePassageEvent(crossSpeed)
|
||||
V2XBizTrace.onAck(crossSpeed, "onV2nNioGreenWavePassageEvent", true)
|
||||
V2XBizTrace.onAck(crossSpeed, "onV2nNioGreenWavePassageEvent", true)
|
||||
drawGreenWave(crossSpeed)
|
||||
}
|
||||
|
||||
override fun onV2nNioOtherRetrogradeEvent(event: MessagePad.Event) {
|
||||
super.onV2nNioOtherRetrogradeEvent(event)
|
||||
CallerLogger.i(TAG, "onV2nNioOtherRetrogradeEvent --> ${event}")
|
||||
V2XBizTrace.onAck(event, "onV2nNioOtherRetrogradeEvent", true)
|
||||
V2XBizTrace.onAck(event, "onV2nNioOtherRetrogradeEvent", true)
|
||||
drawOtherRetrogradeVehicle(event)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user