[6.5.0][道路事件] 只有在车的前面,事件才触发

This commit is contained in:
renwj
2024-07-16 10:58:10 +08:00
parent 0c84dde105
commit 05133cd629

View File

@@ -325,6 +325,16 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
Logger.i(TAG, "isUseGps --> $isUseGps")
val eventLocation = arrayOf(event.longitude, event.latitude)
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)
return@Callback true
}
AiRoadMarker.aiMakers.getOrPut(newEventId) {
val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, eventLocation[0], eventLocation[1])
if (distance > 150) {
@@ -352,11 +362,21 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
val data = msg.obj as? V2nCrossSpeed ?: return@Callback true
val destX = data.lng
val destY = data.lat
val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
if (DrivingDirectionUtils.getDegreeOfCar2Poi(
location.longitude,
location.latitude,
destX,
destY,
location.heading.toInt()
) >= 90) {
V2XBizTrace.onAck(data, "green-wave-event" to "事件在车的后面,不触发", true)
return@Callback true
}
val id = "${destX}_${destY}"
AiRoadMarker.aiMakers.getOrPut(id) {
AiRoadMarker().apply {
try {
val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val current = abs(location.gnssSpeed) * 3.6f.toInt()
val min = abs(data.speedStraightMin * 3.6f).toInt()
val max = abs(data.speedStraightMax * 3.6f).toInt()
@@ -401,6 +421,16 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
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])
if (DrivingDirectionUtils.getDegreeOfCar2Poi(
carLocation.longitude,
carLocation.latitude,
eventLocation[0],
eventLocation[1],
carLocation.heading.toInt()
) >= 90) {
V2XBizTrace.onAck(data, "people-cross" to "事件在车的后面,不触发", true)
return@Callback true
}
AiRoadMarker.aiMakers.getOrPut(data.eventId) {
Logger.i(TAG, "people cross -- 2 --")
if (distance > 150) {