diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt index 1c3b6cfcd4..f538aa58b0 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt @@ -322,10 +322,29 @@ class MoGoAutopilotControlProvider : startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.PAD) } - override fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters) { - startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG) + override fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) { + if (controlParameters==null){ + startAutoPilotWithNoParameter(Constants.AUTOPILOT_SOURCE.MO_FANG) + }else{ + startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG) + } + } + private fun startAutoPilotWithNoParameter(source: Int) { + if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { + val invokeResult = AdasManager.getInstance() + .sendAutoPilotModeReq(1, source, null) + invokeAutoPilotResult(if (invokeResult) "无参自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") + } else { + if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) { + val invokeResult = AdasManager.getInstance() + .sendAutoPilotModeReq(1, source, null) + invokeAutoPilotResult(if (invokeResult) "无参自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") + } else { + invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶 无参") + CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法开启自动驾驶") + } + } } - private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt index 3df523e14b..d4f979dc59 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt @@ -42,7 +42,7 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { * * @param controlParameters 开启自动驾驶的控制参数 */ - fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters) + fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) /** * 给工控机透出路口红绿灯信息 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt index c03f05bc0a..5bbca5918b 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt @@ -93,10 +93,6 @@ object CallerAutoPilotControlManager { clientPkFileName = "sn" ) fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) { - if (controlParameters == null) { - //LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息") - return - } providerApi?.startAutoPilotByMoFang(controlParameters) // 更新记录在全局的控制参数 CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters)