diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingModel.kt index 2392b26090..6db672f5ea 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingModel.kt @@ -492,6 +492,7 @@ object TaxiRoutingModel { CallerLogger.e(TAG, "AutopilotControlParameters is empty.") return } + parameters.isAutoRouting = true OchAutoPilotManager.startAutoPilot(parameters); 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 f1f21e1750..95bfb3c1e0 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 @@ -380,6 +380,11 @@ class MoGoAutopilotControlProvider : startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG) } } + + /** + * 无参数启动自动驾驶,现在的调用方有:魔方 + * @param source 数据来源 + */ private fun startAutoPilotWithNoParameter(source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() @@ -396,15 +401,16 @@ class MoGoAutopilotControlProvider : } } } + private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), false) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.isAutoRouting) invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), false) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.isAutoRouting) invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶") @@ -440,11 +446,11 @@ class MoGoAutopilotControlProvider : ) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) { + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) { AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(),isAutoRouting,routeInfo) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) { + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) { AdasManager.getInstance().sendTrajectoryDownloadReq( autoPilotLine.toAutoPilotLine(), downloadType, diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotControlParameters.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotControlParameters.kt index 4daa8cb771..ac94b2a76c 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotControlParameters.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotControlParameters.kt @@ -139,6 +139,8 @@ class AutopilotControlParameters { @JvmField var autoPilotLine: AutoPilotLine? = null // 自动驾驶路线 + var isAutoRouting = false//是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹 + class AutoPilotLine { var lineId = 0L var lineName = "" @@ -216,15 +218,20 @@ class AutopilotControlParameters { } override fun toString(): String { - return "AutopilotControlParameters{" + - "startName='" + startName + '\'' + - ", endName='" + endName + '\'' + - ", startLatLon=" + startLatLon + - ", wayLatLons=" + wayLatLons + - ", endLatLon=" + endLatLon + - ", speedLimit=" + speedLimit + - ", vehicleType=" + vehicleType + - ", isSpeakVoice=" + isSpeakVoice + - '}' + return "AutopilotControlParameters(" + + "startName='$startName', " + + "endName='$endName', " + + "startLatLon=$startLatLon, " + + "wayLatLons=$wayLatLons," + + "endLatLon=$endLatLon," + + "speedLimit=$speedLimit, " + + "vehicleType=$vehicleType, " + + "routeID=$routeID, " + + "routeName='$routeName', " + + "isSpeakVoice=$isSpeakVoice, " + + "autoPilotLine=$autoPilotLine, " + + "isAutoRouting=$isAutoRouting)" } + + } \ No newline at end of file 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 5d8d0f4ff6..5b6755b01e 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 @@ -56,7 +56,7 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { /** * 发送 轨迹下载请求 */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) + fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) /** * 发送 轨迹下载请求 @@ -66,7 +66,7 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { * @param isAutoRouting 20240523 是否进行自动算路 * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) + fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) /** * 结束自动驾驶 */ 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 945ced2c4a..96befaeb27 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 @@ -182,8 +182,8 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - //TODO 需要传参 isAutoRouting, routeInfo -// providerApi?.sendTrajectoryDownloadReq(autoPilotLine, isAutoRouting, routeInfo) + //TODO Routing 需要传参 isAutoRouting, routeInfo + providerApi?.sendTrajectoryDownloadReq(autoPilotLine, false, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0) } } @@ -194,8 +194,8 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - //TODO 需要传参 isAutoRouting, routeInfo -// providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, isAutoRouting, routeInfo) + //TODO Routing 需要传参 isAutoRouting, routeInfo + providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, false, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType) } }