[6.1.0]修复红绿灯AI云获取失败导致的自车感知闪烁

This commit is contained in:
xuxinchao
2023-09-27 19:19:02 +08:00
parent e624e91464
commit 9a2feb631a

View File

@@ -66,6 +66,11 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
//obu数据
@Volatile
private var hasObuLightStatus: Boolean = false
//是否有自车感知红绿灯数据
@Volatile
private var hasAutopilotPerception: Boolean = false
//红绿灯定时器,超时未更新隐藏红绿灯
@Volatile
private var lightCountDownTimer: CountDownTimer? = null
@@ -90,7 +95,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
)
if (!hasObuLightStatus) {
if (!hasAiLightStatus) {
trafficLights?.let { it ->
trafficLights?.let {
var light: TrafficLight? = null
if (it.hasStraight()) {
light = it.straight
@@ -106,9 +111,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
"onAutopilotPerceptionTrafficLight light = $light "
)
if (light == null) {
hasAutopilotPerception = false
//隐藏红绿灯显示
hide("感知light为null隐藏", DataSourceType.TELEMATIC)
} else {
if(!hasAutopilotPerception){
hasAutopilotPerception = true
}
onTrafficLightPlusSource(light.convert(), 0, DataSourceType.TELEMATIC)
}
}
@@ -128,6 +137,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
}
if (!hasObuLightStatus) {
hasAiLightStatus = true
hasAutopilotPerception = false
CallerLogger.d(
"${SceneConstant.M_D_C}${TAG}",
"onTrafficLightStatus trafficLightResult = $trafficLightResult "
@@ -156,7 +166,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
//如果没有OBU灯态则进行隐藏如果有OBU灯态则交由OBU管理
if (!hasObuLightStatus) {
CallerTrafficLightListenerManager.resetTrafficLightStatus(!hasObuLightStatus)
hide("云端离开路口隐藏", DataSourceType.AICLOUD)
// hide("云端离开路口隐藏", DataSourceType.AICLOUD)
}
}
}
@@ -165,15 +175,15 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
* 红绿灯接口请求失败
*/
override fun onTrafficRequestError() {
hasAiLightStatus = false
CallerLogger.d(
"${SceneConstant.M_D_C}${TAG}",
"onTrafficRequestError hasObuLightStatus = $hasObuLightStatus ------> "
)
CallerTrafficLightListenerManager.resetTrafficLightStatus(!hasObuLightStatus)
if (!hasObuLightStatus) {
hide("云端红绿灯接口请求失败隐藏", DataSourceType.AICLOUD)
}
CallerTrafficLightListenerManager.resetTrafficLightStatus(hasAiLightStatus)
hasAiLightStatus = false
// if (!hasObuLightStatus) {
// hide("云端红绿灯接口请求失败隐藏", DataSourceType.AICLOUD)
// }
}
/**
@@ -186,14 +196,14 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
}
/**
* 是否重置红绿灯数据,需要确保在obu的红绿灯显示的时候不执行。否则会闪屏
* 是否重置红绿灯数据,需要确保在obu的红绿灯显示或自车感知红绿灯显示的时候,不执行。否则会闪屏
*/
override fun resetTrafficLight(isReset: Boolean) {
CallerLogger.d(
"${SceneConstant.M_D_C}${TAG}",
"resetTrafficLight ------> isReset = $isReset ---hasObuLightStatus = $hasObuLightStatus"
)
if (!hasObuLightStatus) {
if (!hasObuLightStatus && !hasAutopilotPerception) {
if (isReset) {
hide("云端重置红绿灯数据", DataSourceType.AICLOUD)
}
@@ -228,6 +238,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
super.onTrafficLightPlusSource(light, remain, lightSource)
if (lightSource == DataSourceType.OBU) {
hasObuLightStatus = true
hasAutopilotPerception = false
}
CallerLogger.d(
"${SceneConstant.M_D_C}${TAG}",