[code_opt_3.3.0] split autopilot status and param

This commit is contained in:
zhongchao
2023-06-12 14:08:23 +08:00
parent df55cd543b
commit ef689a9685
36 changed files with 742 additions and 783 deletions

View File

@@ -28,11 +28,11 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SO
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SOCKET_TRAJECTORY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SOCKET_VEHICLE
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeArriveAtStation
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotGuardian
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotSNRequest
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotStatusRespByQuery
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.CallerAutopilotActionsListenerManager.invokeAutopilotAbility
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
@@ -119,7 +119,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
)
override fun onGnssInfo(header: MessagePad.Header, gnssInfo: MessagePad.GnssInfo) {
CallerChassisGnssListenerManager.invokeChassisGnssListener(gnssInfo)
if (gnssInfo != null) {
if (1 == FunctionBuildConfig.gpsProvider) {
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
@@ -356,8 +355,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
carConfigResp: MessagePad.CarConfigResp?
) {
if (carConfigResp != null) {
val autopilotStatusInfo = getAutoPilotStatusInfo()
autopilotStatusInfo.dockVersion = carConfigResp.dockVersion
updateAutoPilotDockerInfo(carConfigResp.dockVersion)
AppConfigInfo.dockerVersion = carConfigResp.dockVersion
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
@@ -576,9 +574,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
* @param rsi 数据
*/
@ChainLog(
linkChainLog = ChainConstant.CHAIN_TYPE_CLOUD_V2N,
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_V2N,
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
paramIndexes = [0, 1]
)
override fun onV2nCongestionEvent(header: MessagePad.Header, rsi: MogoV2X.RSI_PB) {
@@ -596,9 +594,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
* @param parkingViolation 违停 ---包含 静态障碍车
*/
@ChainLog(
linkChainLog = ChainConstant.CHAIN_TYPE_CLOUD_V2N,
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_V2N,
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
paramIndexes = [0]
)
override fun onV2nGlobalPathEvents(

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.datacenter.autopilot.server
import android.annotation.SuppressLint
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
@@ -36,7 +35,6 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
}
}
private var mPreAutoStatus = AtomicInteger(-1)
private var createSubscribe: Disposable? = null
fun initServer() {
@@ -45,16 +43,11 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
}
@SuppressLint("CheckResult")
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
super.onAutopilotStatusResponse(autoPilotStatusInfo)
val state = autoPilotStatusInfo.state
if (mPreAutoStatus.get() != state) {
mPreAutoStatus.set(state)
createSubscribe?.let {
if (!it.isDisposed) {
bizLog(SceneConstant.M_ADAS_IMPL + TAG, "自动驾驶状态变化取消前置轨迹请求间隔2s重新请求底盘轨迹")
createSubscribe?.dispose()
}
override fun onAutopilotStatusResponse(state: Int) {
createSubscribe?.let {
if (!it.isDisposed) {
bizLog(SceneConstant.M_ADAS_IMPL + TAG, "自动驾驶状态变化取消前置轨迹请求间隔2s重新请求底盘轨迹")
createSubscribe?.dispose()
}
when (state) {

View File

@@ -65,10 +65,7 @@ class TeleMsgHandler : IMsgHandler {
AdasManager.getInstance().decoderRaw(it.body)
} catch (e: Exception) {
e.printStackTrace()
CallerLogger.e(
"${SceneConstant.M_ADAS_IMPL}$TAG",
"乘客屏解析数据过程中出现异常:${e.message}"
)
invokeNettyConnResult("乘客屏解析数据过程中出现异常:${e.message}")
}
}
MogoProtocolMsg.SYNC_MODE_STATUS -> {
@@ -144,11 +141,6 @@ class TeleMsgHandler : IMsgHandler {
CallerTrafficLightListenerManager.invokeEnterCrossRoad(false)
}
}
TelematicConstant.OPEN_ROMA_STATUS -> {
ThreadUtils.runOnUiThread {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.OPEN_ROMA_STATUS,it.body)
}
}
TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR -> {
ThreadUtils.runOnUiThread {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,it.body)
@@ -223,11 +215,6 @@ class TeleMsgHandler : IMsgHandler {
TelematicConstant.BUSINESS_STRING -> {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.BUSINESS_STRING, it.body)
}
TelematicConstant.OPEN_ROMA_STATUS -> {
ThreadUtils.runOnUiThread {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.OPEN_ROMA_STATUS,it.body)
}
}
else -> {
}
}