[dev_robotaxi-d-app-module_2132_221223_2.13.2_sop] 修改obu红绿灯消失的状态回调

This commit is contained in:
lixiaopeng
2023-02-14 19:38:47 +08:00
parent d8b5c2fb8d
commit f1c1fd34eb
5 changed files with 100 additions and 66 deletions

View File

@@ -5,10 +5,12 @@ import android.os.Handler
import android.util.Log
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightDisapperListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightDisappearManager
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
@@ -21,7 +23,7 @@ import perception.TrafficLightOuterClass.TrafficLight
* @since: 2022/4/28
*/
class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLightListener,
IMoGoObuTrafficLightListener {
IMoGoObuTrafficLightListener, IMoGoObuTrafficLightDisapperListener {
companion object {
const val TAG = "TrafficLightDispatcher"
@@ -50,6 +52,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
//obu红绿灯数据
CallerObuTrafficLightListenerManager.registerObuTrafficLightListener(TAG, this)
//obu红绿灯数据消失
CallerObuTrafficLightDisappearManager.registerObuTrafficLightListener(TAG, this)
}
/**
@@ -153,6 +157,10 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
CallerHmiManager.showWarningTrafficLight(light, 3)
}
override fun onObuLightDisapper() {
hasObuLightStatus = false
}
fun destroy() {
//取消注册监听AI云获取红绿灯状态
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)