[pb9][底盘接口] 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留老底盘接口回调,M1新添加的相关字段会在老底盘回调接收,同时老底盘的清扫车对象转成新底盘PB中的清扫车对象,暂时注释掉ADAS LIB中的新老底盘兼容

This commit is contained in:
xinfengkun
2023-01-10 18:12:25 +08:00
parent 65838501c1
commit a7d179d713
8 changed files with 103 additions and 1 deletions

View File

@@ -143,6 +143,52 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
/**
* 老底盘信息,透传底盘状态pb参考底盘
* TODO 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留
* TODO 后期会优化掉具体时间未知需要工控机端新老底盘PB字段对齐
*
* @param header 头
* @param vehicleState 数据
*/
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE,
linkCode = CHAIN_LINK_ADAS,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE,
paramIndexes = [0, 1],
clientPkFileName = "sn"
)
override fun onVehicleState(header: MessagePad.Header, vehicleState: VehicleStateOuterClass.VehicleState?) {
if (vehicleState != null) {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂挡档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake)
//清扫车(福田)清扫控制系统状态
vehicleState.sweeperFutianCleanSystemState?.also { sweeperState ->
val bytes: ByteArray = sweeperState.toByteArray()
val cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates? = ChassisStatesOuterClass.SweeperFuTianTaskSystemStates.parseFrom(bytes)
cleanSystemState?.let {
CallerSweeperFutianCleanSystemListenerManager.invokeSweeperFutianCleanSystemState(it)
}
}
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
}
}
/**
* 底盘数据
*