[Sweeper-Cloud] refactor: 清扫车适配魔方,启动自驾接口时source传递魔方,以便telematics区分并处理;
This commit is contained in:
@@ -10,30 +10,29 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_MULTI_CONNECT
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.server.AsyncDataToAutopilotServer
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.telematic.EventListener
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.telematic.IMsgHandler
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.telematic.TeleMsgHandler
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
@@ -320,14 +319,22 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
|
||||
override fun startAutoPilot(controlParameters: AutopilotControlParameters) {
|
||||
startAutoPilot(controlParameters, AdasOptions.AUTOPILOT_SOURCE.PAD)
|
||||
}
|
||||
|
||||
override fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters) {
|
||||
startAutoPilot(controlParameters, AdasOptions.AUTOPILOT_SOURCE.MO_FANG)
|
||||
}
|
||||
|
||||
private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
.sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
|
||||
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo())
|
||||
invokeAutoPilotResult(if (invokeResult) "自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
|
||||
} else {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
.sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
|
||||
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo())
|
||||
invokeAutoPilotResult(if (invokeResult) "自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
|
||||
} else {
|
||||
invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶")
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.view.KeyEvent
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener
|
||||
@@ -17,9 +18,11 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetAcceleratedSpeed
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetHorn
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilotByMoFang
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager.invokeMoFangStatus
|
||||
import com.mogo.eagle.core.function.call.mofang.CallerMofangListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_F
|
||||
@@ -319,7 +322,12 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms")
|
||||
}
|
||||
startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters)
|
||||
//清扫车有FSM模块,魔方启动自驾时需要将Source修改为魔方,以便telamatics做区分并在转发时增加flag标记
|
||||
if (AppIdentityModeUtils.isSweeper(FunctionBuildConfig.appIdentityMode)) {
|
||||
startAutoPilotByMoFang(getAutoPilotStatusInfo().autopilotControlParameters)
|
||||
} else{
|
||||
startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,13 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters)
|
||||
|
||||
/**
|
||||
* 开启自动驾驶(魔方)
|
||||
*
|
||||
* @param controlParameters 开启自动驾驶的控制参数
|
||||
*/
|
||||
fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters)
|
||||
|
||||
/**
|
||||
* 给工控机透出路口红绿灯信息
|
||||
*/
|
||||
|
||||
@@ -79,6 +79,29 @@ object CallerAutoPilotControlManager {
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*
|
||||
* @param controlParameters 开启自动驾驶的控制参数
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) {
|
||||
if (controlParameters == null) {
|
||||
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")
|
||||
return
|
||||
}
|
||||
providerApi?.startAutoPilotByMoFang(controlParameters)
|
||||
// 更新记录在全局的控制参数
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送红绿灯数据至工控机
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,28 @@ public class AdasOptions {
|
||||
int ASSIGN = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动自动驾驶-Source类型
|
||||
*/
|
||||
public interface AUTOPILOT_SOURCE {
|
||||
/**
|
||||
* pad模拟
|
||||
*/
|
||||
int PAD_SIMULATE = 0;
|
||||
/**
|
||||
* pad业务
|
||||
*/
|
||||
int PAD = 1;
|
||||
/**
|
||||
* AICloud
|
||||
*/
|
||||
int AI_CLOUD = 2;
|
||||
/**
|
||||
* 魔方
|
||||
*/
|
||||
int MO_FANG = 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是客户端 true:客户度(乘客屏) false:服务端(司机屏)
|
||||
* 当是乘客端的情况下 ipcConnectionMode ipcAssignIP ipcFixationIPSet 均无效
|
||||
|
||||
Reference in New Issue
Block a user