[660][adas][data-center] FSM与Can Adapter自动驾驶状态兼容,鹰眼全局自动驾驶状态新增来源字段,新增Can Adapter自驾状态回调接口

This commit is contained in:
xinfengkun
2024-08-23 15:21:14 +08:00
parent 9b39ee7244
commit 45d5576288
12 changed files with 111 additions and 26 deletions

View File

@@ -40,6 +40,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeSystemStatus
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotDockerInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotStatus
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotStatusFromCan
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.invokeAutopilotAbility
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
@@ -82,6 +83,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_D_C
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.support.obu.ObuScene
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasListener
import com.zhidao.support.adas.high.chain.AdasChain
import com.zhjt.mogo.adas.data.bean.AdasParam
@@ -277,8 +279,12 @@ class MoGoAdasListenerImpl : OnAdasListener {
autopilotState: MessagePad.AutopilotState?
) {
if (autopilotState != null) {
//工控机模拟时间
updateAutoPilotStatus(autopilotState.state, autopilotState.autopilotMode)
updateAutoPilotStatusFromCan(autopilotState.state)
if (AdasManager.getInstance()
.getNodeStateInfo(AdasConstants.NodeName.FSM2024).existState != NodeExistState.NODE_EXIST_NORMAL
) {
updateAutoPilotStatus(1, autopilotState.state, autopilotState.autopilotMode)
}
}
}
@@ -472,10 +478,27 @@ class MoGoAdasListenerImpl : OnAdasListener {
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
linkCode = CHAIN_SOURCE_ADAS,
nodeAliasCode = CHAIN_CODE_ADAS_FSM_MSG,
paramIndexes = [0, 1]
paramIndexes = [0, 1, 2]
)
override fun onFSM2024State(header: MessagePad.Header, fsmState: Fsm2024.FSMStateMsg) {
override fun onFSM2024State(
header: MessagePad.Header,
fsmState: Fsm2024.FSMStateMsg,
autopilotState: Int,
autopilotMode: Int
) {
CallerFsm2024ListenerManager.invokeFSM2024State(fsmState)
// val mode: Int = if (fsmState.functionState != Fsm2024.State.ACTIVE) {
// 0//人工驾驶
// } else {
// if (fsmState.activeMode == Fsm2024.ActiveMode.PILOT_ACTIVE) {
// 1//自动驾驶
// } else if (fsmState.activeMode == Fsm2024.ActiveMode.PARALLEL_ACTIVE || fsmState.activeMode.number == 6) {
// 6//远程驾驶
// } else {
// 0//人工驾驶
// }
// }
updateAutoPilotStatus(2, autopilotState, autopilotMode)
}
/**

View File

@@ -82,6 +82,7 @@ class MoGoAdasMsgConnectStatusListenerImpl :
//与工控机断开连接,需要重置自动驾驶状态(包括上传至云平台缓存信息),等待连接成功后同步状态信息
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state = 0
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode = 0
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotStateSource = 0
isReceivedBasicInfoReq.set(false)
isSentBasicInfoReq.set(false)
}