[6.6.0] union the chassis state in one caller

This commit is contained in:
EmArrow
2024-08-21 17:11:05 +08:00
parent c53b9359cf
commit cbe8c27e4c
55 changed files with 789 additions and 818 deletions

View File

@@ -47,17 +47,10 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerBackCameraVideoListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisAccStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisDoorStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerFaultManagementStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerFsm2024ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerLocalizationStateListenerManager
@@ -194,27 +187,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
CallerAutopilotActionsListenerManager.setVehicleState(vehicleState)
if (vehicleState != null) {
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂档档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake)
// 处理车辆状态
CallerChassisStatesListenerManager.invokeStates(vehicleState)
//车门
CallerChassisDoorStateListenerManager.invokeAutopilotDoorState(vehicleState.doorStateList)
//电量
if (vehicleState.hasBmsSoc()) {
CallerBatteryManagementSystemListenerManager.invokeBatteryManagementSystemStates(
ChassisStatesOuterClass.BMSSystemStates.newBuilder()
.setBmsSoc(vehicleState.bmsSoc).build()
)
}
//清扫车(福田)清扫控制系统状态
vehicleState.sweeperFutianCleanSystemState?.also { sweeperState ->
val bytes: ByteArray = sweeperState.toByteArray()
@@ -233,7 +209,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
CallerChassisStatesListenerManager.invokeStatesDataException(header.timestamp.toLong())
}
}
@@ -255,36 +231,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
CallerAutopilotActionsListenerManager.setChassisStates(chassisStates)
if (chassisStates != null) {
chassisStates.bcmSystemStates?.let { bcmSystemStates ->
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(bcmSystemStates.brakeLightState != 0)
}
chassisStates.steerSystemStates?.let {
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(it.steeringWheelAngle)
}
chassisStates.gearSystemStates?.let { gearSystemStates ->
gearSystemStates.gearPosition?.let {
//挂档档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(it)
}
}
chassisStates.vehicleMotionStates?.let {
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(it.acceleration)
}
chassisStates.drivingSystemStates?.let {
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(it.throttleResponsePosition)
}
chassisStates.brakeSystemStates?.let {
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(it.brakePedalResponsePosition)
}
chassisStates.bmsSystemStates?.let {
//电量
CallerBatteryManagementSystemListenerManager.invokeBatteryManagementSystemStates(it)
}
CallerChassisStatesListenerManager.invokeNewStates(chassisStates)
chassisStates.taskSystemStates?.let { taskSystemStates ->
taskSystemStates.sweeperFutianTaskSystemStates?.let {
//清扫车(福田)清扫控制系统状态
@@ -294,7 +241,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
CallerChassisStatesListenerManager.invokeStatesDataException(header.timestamp.toLong())
}
}
@@ -308,7 +255,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
*/
override fun onLightSwitch(light: Chassis.LightSwitch) {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(light)
CallerChassisStatesListenerManager.invokeAutopilotLightSwitchData(light)
}
//自动驾驶状态
@@ -324,7 +271,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
if (autopilotState != null) {
//工控机模拟时间
CallerAutopilotVehicleStateListenerManager.invokeAutopilotTime(header.timestamp.toLong())
updateAutoPilotStatus(autopilotState.state, autopilotState.autopilotMode)
}
}