Merge branch 'dev_robotaxi-d_230912_6.1.0' into dev_minibus-d_230926_6.1.0

This commit is contained in:
yangyakun
2023-09-28 09:50:34 +08:00
6 changed files with 54 additions and 35 deletions

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)
}
}
@@ -127,7 +136,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
)
}
if (!hasObuLightStatus) {
hasAiLightStatus = true
CallerLogger.d(
"${SceneConstant.M_D_C}${TAG}",
"onTrafficLightStatus trafficLightResult = $trafficLightResult "
@@ -156,7 +164,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
//如果没有OBU灯态则进行隐藏如果有OBU灯态则交由OBU管理
if (!hasObuLightStatus) {
CallerTrafficLightListenerManager.resetTrafficLightStatus(!hasObuLightStatus)
hide("云端离开路口隐藏", DataSourceType.AICLOUD)
// hide("云端离开路口隐藏", DataSourceType.AICLOUD)
}
}
}
@@ -165,15 +173,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 +194,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 +236,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}",
@@ -293,6 +302,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
"updateTrafficLight ----- currentTrafficLight = $currentTrafficLight"
)
currentTrafficLight?.let {
hasAiLightStatus = true
hasAutopilotPerception = false
val remain = if (it.time() > 99) {
99
} else {

View File

@@ -99,6 +99,10 @@ class ParallelDriveView @JvmOverloads constructor(
ToastUtils.showShort("请求已取消!")
checkAvailableAndUpdateUI()
}
AD_REQUESTING -> {
Log.d(TAG, "Click-自动驾驶正在请求平行驾驶")
ToastUtils.showShort("自动驾驶正在请求平行驾驶")
}
UNAVAILABLE -> {
Log.d(TAG, "Click-请P档驻车并松开油门刹车后请求")
ToastUtils.showShort("请P档驻车并松开油门刹车后请求")
@@ -251,7 +255,7 @@ class ParallelDriveView @JvmOverloads constructor(
AD_REQUESTING -> {
stopSyncAnimation()
rootLayout.isEnabled = false
rootLayout.isEnabled = true
statusIconOuter.visibility = GONE
rootLayout.alpha = 1f
statusIcon.background =

View File

@@ -290,18 +290,6 @@
android:textOn="关闭obu预警融合"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbCronet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启QUIC协议(网络信号差时)"
android:textOn="关闭QUIC协议"
android:textSize="@dimen/dp_24" />
<!-- APP升级数据 start -->
<ToggleButton
android:id="@+id/tbAppUpgrade"
@@ -2365,6 +2353,17 @@
</LinearLayout>
</LinearLayout>
<ToggleButton
android:id="@+id/tbCronet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启QUIC协议(服务器暂不支持)"
android:textOn="关闭QUIC协议"
android:textSize="@dimen/dp_24" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>