[V2X]鬼探头道路预警逻辑优化

This commit is contained in:
renwj
2022-05-06 20:05:34 +08:00
parent 4e003df875
commit e4121da473
15 changed files with 37 additions and 28 deletions

View File

@@ -558,7 +558,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
// 显示弹框,语音提示
CallerHmiManager.showWarningV2X(
appId,
appId.toString(),
content,
tts,
"$appId",

View File

@@ -8,6 +8,8 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -50,7 +52,13 @@ public class V2XAlarmServer {
// 计算车辆距离指定气泡的距离
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
// 1、判断是否到达了触发距离,20 ~ 500,
if (v2XRoadEventEntity.getDistance() <= 500) {
double distance = v2XRoadEventEntity.getDistance();
if (distance <= 500) {
if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (distance > 15) {
continue;
}
}
// 2、道路事件方向与当前行驶方向角度偏差《20度以内
double carBearing = currentLocation.getBearing();
double eventBearing = eventLocation.getAngle();

View File

@@ -98,7 +98,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
V2XRoadEventEntity content = entity != null ? entity.getContent() : null;
if (content != null) {
//显示警告红边
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType(), content.getAlarmContent(), content.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(5));
CallerHmiManager.INSTANCE.showWarningV2X(content.getPoiType(), content.getAlarmContent(), content.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(5));
}
}

View File

@@ -53,7 +53,7 @@ public class V2XOptimalRouteVREventScenario
if (entity != null) {
V2XOptimalRouteDataRes content = entity.getContent();
if (content != null) {
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType(), "为您推荐最优路线", "已为您选择最优路线", TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30));
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType() + "", "为您推荐最优路线", "已为您选择最优路线", TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30));
}
}
}

View File

@@ -59,7 +59,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
V2XMessageEntity entity = getV2XMessageEntity();
if (v2xType != 0) {
CallerHmiManager.INSTANCE.showWarningV2X(v2xType, getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(3));
CallerHmiManager.INSTANCE.showWarningV2X(v2xType + "", getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(3));
}
}
}

View File

@@ -169,7 +169,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
private fun redLightWarning() {
CallerLogger.d("$M_V2X$TAG", "=====闯红灯预警=====")
ThreadUtils.runOnUiThread {
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType.toInt(), EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L)
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L)
}
}
@@ -187,7 +187,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
speed
)
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType.toInt(), content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L)
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L)
}
}

View File

@@ -131,7 +131,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
if (abs(currentResult!!.remain - it.remain) > 5 && currentResult.isGreen()) {
CallerLogger.d("$M_V2X$TAG", "调用showWarningV2X to show")
CallerHmiManager.showWarningV2X(
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType.toInt(),
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType,
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType,

View File

@@ -30,7 +30,7 @@
"lat":39.969055,
"lon":116.410811
},
"poiType":"10011",
"poiType":"10024",
"type":"CARD_TYPE_ROAD_CONDITION",
"uploadType":"2",
"userInfo":{
@@ -41,5 +41,5 @@
"userName":"零下的雨"
}
},
"poiType":"10011"
"poiType":"10024"
}