[640][adas] 能否启动自驾条件新增 油门方向盘危险报警灯状态判断,抽离底盘相关原因父类;添加车灯状态单独接口,用于统一解析后的车灯状态,目前输出:左右转灯和双闪灯

This commit is contained in:
xinfengkun
2024-04-10 17:29:21 +08:00
parent a6487c4966
commit 81389d56ab
27 changed files with 486 additions and 333 deletions

View File

@@ -132,7 +132,7 @@ class MoGoAutopilotControlProvider :
.setEnableCertification(SharedPrefsMgr.getInstance().getBoolean("${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}", MoGoConfig.AUTOPILOT_CERTIFICATION_DEFAULT_VALUE))
.setRootCrt(CallerCloudCertManager.getRootCrtFDecode())
.setDeviceCrt(CallerCloudCertManager.getDeviceCrtFDecode())
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
.setLaunchAutopilotGear(FunctionBuildConfig.launchAutopilotGear)
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
.build()
@@ -228,7 +228,7 @@ class MoGoAutopilotControlProvider :
val options = AdasOptions
.newBuilder()
.setPassenger(true)
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
.setLaunchAutopilotGear(FunctionBuildConfig.launchAutopilotGear)
.build()
AdasManager.getInstance()
.create(mContext, options, MoGoAdasMsgConnectStatusListenerImpl())
@@ -263,7 +263,7 @@ class MoGoAutopilotControlProvider :
.setEnableCertification(SharedPrefsMgr.getInstance().getBoolean("${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}", MoGoConfig.AUTOPILOT_CERTIFICATION_DEFAULT_VALUE))
.setRootCrt(CallerCloudCertManager.getRootCrtFDecode())
.setDeviceCrt(CallerCloudCertManager.getDeviceCrtFDecode())
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
.setLaunchAutopilotGear(FunctionBuildConfig.launchAutopilotGear)
.build()
AdasManager.getInstance().create(mContext, options, MoGoAdasMsgConnectStatusListenerImpl())
//////////////////////////////////注意先后顺序AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
import bag_manager.BagManagerOuterClass
import chassis.Chassis
import chassis.ChassisStatesOuterClass
import chassis.VehicleStateOuterClass
import com.mogo.eagle.core.data.app.AppConfigInfo
@@ -169,7 +170,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
if (vehicleState != null) {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
// CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据
@@ -231,10 +232,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
if (chassisStates != null) {
chassisStates.bcmSystemStates?.let { bcmSystemStates ->
bcmSystemStates.turnLightState?.let {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(it)
}
// bcmSystemStates.turnLightState?.let {
// //转向灯数据
// CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(it)
// }
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(bcmSystemStates.brakeLightState != 0)
}
@@ -277,6 +278,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
/**
* 底盘车灯状态 转换过的可以直接使用
* 例如:
* 原始右转数据: 0 2 0 2 0 2。。。
* 转换之后数据: 2 2 2 2 2 2。。。
*
* @param light 车灯 目前域控发送车灯有 左传{@link Chassis.LightSwitch#LIGHT_LEFT} 右转{@link Chassis.LightSwitch#LIGHT_RIGHT} 危险报警灯{@link Chassis.LightSwitch#LIGHT_FLASH}
*/
override fun onLightSwitch(light: Chassis.LightSwitch) {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(light)
}
//自动驾驶状态
@ChainLog(
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,