From 2278c848e0330f1760eeeb4a5a2e83209b122259 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Fri, 24 May 2024 13:20:08 +0800 Subject: [PATCH 01/10] =?UTF-8?q?[adas]=20=E5=90=AF=E5=8A=A8=E8=87=AA?= =?UTF-8?q?=E9=A9=BE=E4=B8=8E=E4=B8=8B=E8=BD=BD=E8=BD=A8=E8=BF=B9=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=E7=AE=97=E8=B7=AF?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/MoGoAutopilotControlProvider.kt | 26 ++++++++++------- .../IMoGoAutopilotControlProvider.kt | 11 +++++-- .../CallerAutoPilotControlManager.kt | 6 ++-- .../src/main/proto/message_pad.proto | 11 +++++++ .../zhidao/support/adas/high/AdasChannel.java | 26 ++++++++++++----- .../zhidao/support/adas/high/AdasManager.java | 29 +++++++++++-------- .../support/adas/high/IAdasNetCommApi.java | 17 ++++++----- 7 files changed, 83 insertions(+), 43 deletions(-) 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 b932142efa..f1f21e1750 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 @@ -383,12 +383,12 @@ class MoGoAutopilotControlProvider : private fun startAutoPilotWithNoParameter(source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, null) + .sendAutoPilotModeReq(1, source, null, false) invokeAutoPilotResult(if (invokeResult > -1) "无参自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, null) + .sendAutoPilotModeReq(1, source, null, false) invokeAutoPilotResult(if (invokeResult > -1) "无参自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶 无参") @@ -399,12 +399,12 @@ class MoGoAutopilotControlProvider : private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo()) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), false) 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()) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), false) invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶") @@ -440,17 +440,21 @@ class MoGoAutopilotControlProvider : ) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) { - AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine()) + 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) { - AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(), downloadType) + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) { + AdasManager.getInstance().sendTrajectoryDownloadReq( + autoPilotLine.toAutoPilotLine(), + downloadType, + isAutoRouting, + routeInfo) } override fun cancelAutoPilot() { if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) { - AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null) + AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null, false) } else { CallerLogger.e("$M_D_C$TAG", "车机与工控机链接失败,无法断开自动驾驶") } @@ -920,11 +924,11 @@ class MoGoAutopilotControlProvider : */ override fun setControlAutopilotCarAuto(isEnable: Boolean) { if (isEnable) { - AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null) + AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null, false) } else { // 司机屏才可关闭自动驾驶 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null) + AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null, false) } } } 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 805b79c7e9..5d8d0f4ff6 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 @@ -13,6 +13,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm.TaskConfi import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop.StopTaskResp import com.zhjt.mogo.adas.data.AdasConstants import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume.BigTaskActionResp +import mogo.telematics.pad.MessagePad import mogo.yycp.paralleldriving.protocol.ParallelDrivingRequest /** @@ -55,13 +56,17 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { /** * 发送 轨迹下载请求 */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) + fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) /** * 发送 轨迹下载请求 - * @param downloadType 下载类型: 0:正常下载 1:预下载 + * + * @param autoPilotLine 线路相关参数详情见PB message_pad.proto -> Line + * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param isAutoRouting 20240523 是否进行自动算路 + * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) + 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 2abbfb75b6..945ced2c4a 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,7 +182,8 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - providerApi?.sendTrajectoryDownloadReq(autoPilotLine) + //TODO 需要传参 isAutoRouting, routeInfo +// providerApi?.sendTrajectoryDownloadReq(autoPilotLine, isAutoRouting, routeInfo) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0) } } @@ -193,7 +194,8 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType) + //TODO 需要传参 isAutoRouting, routeInfo +// providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, isAutoRouting, routeInfo) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType) } } diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index 962820c486..bbb60baffe 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -272,6 +272,9 @@ message TrajectoryDownloadReq Line line = 1; //路线 uint32 source = 2; //指令来源: 0: default, 1:pad, 2:aicloud uint32 downloadType = 3; //下载类型: 0:正常下载 1:预下载 + + bool isAutoRouting = 4; //20240523 是否进行自动算路 + RouteInfo routeInfo = 5; //20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! } // message definition for MessageType: MsgTypeBasicInfoReq @@ -297,6 +300,8 @@ message Location double latitude = 2; double altitude = 3; double heading = 4; + + bool station = 5; //20240523, 判断此点是中间站点还是途径点 ------- true:站点, false:简单的途径点 } message RouteInfo @@ -312,6 +317,10 @@ message RouteInfo uint32 routeID = 9; string routeName = 10; Line line = 11; //路线信息 + + string newRoutingMd5 = 12; //20240523 默认空值"":原有轨迹线路;若存在有效MD5值,新算路信息 + repeated Location blackPoints = 13; //20240523 不让走的道路,异常线路点 + bool isRestart = 14; //20240523 用于表示判断是否是起点下单。默认false:起点下单, true: 中间站点下单 或者接管后重新启动 } message SetAutopilotModeReq @@ -319,6 +328,8 @@ message SetAutopilotModeReq uint32 mode = 1; //1: enter autopilot mode, 0: quit autopilot mode uint32 source = 2; //命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) RouteInfo routeInfo = 3; //自动驾驶路径信息 + + bool isAutoRouting = 4; //20240523 是否进行自动算路 } // message definition for MsgTypeSetDemoModeReq diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java index 6460ecf0bf..f3d0c82a56 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java @@ -1189,21 +1189,23 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec * 设置自动驾驶模式 启动自动驾驶 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param mode 1: enter autopilot mode, 0: quit autopilot mode - * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) - * @param routeInfo 自动驾驶路径信息 + * @param mode 1: enter autopilot mode, 0: quit autopilot mode + * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) + * @param routeInfo 自动驾驶路径信息 + * @param isAutoRouting 20240523 是否进行自动算路 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ @Override - public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo) { + public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo, boolean isAutoRouting) { MessagePad.SetAutopilotModeReq.Builder builder = MessagePad.SetAutopilotModeReq.newBuilder(); builder.setMode(mode); builder.setSource(source); if (routeInfo != null) builder.setRouteInfo(routeInfo); + builder.setIsAutoRouting(isAutoRouting); MessagePad.SetAutopilotModeReq req = builder.build(); if (autopilotReview != null) autopilotReview.onAutopilotCommandTrigger(req); return sendPBMessage(MessageType.TYPE_SEND_SET_AUTOPILOT_MODE_REQ, req.toByteArray()); @@ -1655,8 +1657,10 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec * 发送 轨迹下载请求 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param line 线路相关参数详情见PB message_pad.proto -> Line - * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param line 线路相关参数详情见PB message_pad.proto -> Line + * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param isAutoRouting 20240523 是否进行自动算路 + * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 @@ -1669,13 +1673,19 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec paramIndexes = {0} ) @Override - public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType) { + public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, boolean isAutoRouting, MessagePad.RouteInfo routeInfo) { MessagePad.TrajectoryDownloadReq.Builder builder = MessagePad.TrajectoryDownloadReq.newBuilder(); builder.setSource(1);//指令来源: 0: default, 1:pad, 2:aicloud - builder.setLine(line); + if (line != null) { + builder.setLine(line); + } if (downloadType > -1) { builder.setDownloadType(downloadType); } + builder.setIsAutoRouting(isAutoRouting); + if (routeInfo != null) { + builder.setRouteInfo(routeInfo); + } MessagePad.TrajectoryDownloadReq req = builder.build(); return sendPBMessage(MessageType.TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ, req.toByteArray()); } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java index f29f121e3c..7f9669cdf3 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java @@ -393,17 +393,18 @@ public class AdasManager implements IAdasNetCommApi { * 设置自动驾驶模式 启动自动驾驶 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param mode 1: enter autopilot mode, 0: quit autopilot mode - * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) - * @param routeInfo 自动驾驶路径信息 + * @param mode 1: enter autopilot mode, 0: quit autopilot mode + * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) + * @param routeInfo 自动驾驶路径信息 + * @param isAutoRouting 20240523 是否进行自动算路 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ @Override - public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo) { - return mChannel == null ? -1L : mChannel.sendAutoPilotModeReq(mode, source, routeInfo); + public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo, boolean isAutoRouting) { + return mChannel == null ? -1L : mChannel.sendAutoPilotModeReq(mode, source, routeInfo, isAutoRouting); } /** @@ -758,30 +759,34 @@ public class AdasManager implements IAdasNetCommApi { * 发送 轨迹下载请求 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param line 线路相关参数详情见PB message_pad.proto -> Line + * @param line 线路相关参数详情见PB message_pad.proto -> Line + * @param isAutoRouting 20240523 是否进行自动算路 + * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ - public long sendTrajectoryDownloadReq(MessagePad.Line line) { - return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1); + public long sendTrajectoryDownloadReq(MessagePad.Line line, boolean isAutoRouting, MessagePad.RouteInfo routeInfo) { + return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1, isAutoRouting, routeInfo); } /** * 发送 轨迹下载请求 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param line 线路相关参数详情见PB message_pad.proto -> Line - * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param line 线路相关参数详情见PB message_pad.proto -> Line + * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param isAutoRouting 20240523 是否进行自动算路 + * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ @Override - public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType) { - return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, downloadType); + public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, boolean isAutoRouting, MessagePad.RouteInfo routeInfo) { + return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, downloadType, isAutoRouting, routeInfo); } /** diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java index 5ba39f8bf5..557e3f4447 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java @@ -173,15 +173,16 @@ public interface IAdasNetCommApi { * 设置自动驾驶模式 启动自动驾驶 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param mode 1: enter autopilot mode, 0: quit autopilot mode - * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) - * @param routeInfo 自动驾驶路径信息 + * @param mode 1: enter autopilot mode, 0: quit autopilot mode + * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) + * @param routeInfo 自动驾驶路径信息 + * @param isAutoRouting 20240523 是否进行自动算路 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ - long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo); + long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo, boolean isAutoRouting); /** @@ -475,14 +476,16 @@ public interface IAdasNetCommApi { * 发送 轨迹下载请求 * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * - * @param line 线路相关参数详情见PB message_pad.proto -> Line - * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param line 线路相关参数详情见PB message_pad.proto -> Line + * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param isAutoRouting 20240523 是否进行自动算路 + * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ - long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType); + long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, boolean isAutoRouting, MessagePad.RouteInfo routeInfo); /** * 发送 状态查询请求 From 86e6e4483a060207534c4021067279db397b5ee6 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 24 May 2024 18:29:41 +0800 Subject: [PATCH 02/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E5=90=AF=E5=8A=A8Routing=E8=87=AA=E5=8A=A8=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/taxi/ui/routing/TaxiRoutingModel.kt | 1 + .../autopilot/MoGoAutopilotControlProvider.kt | 14 +++++++--- .../autopilot/AutopilotControlParameters.kt | 27 ++++++++++++------- .../IMoGoAutopilotControlProvider.kt | 4 +-- .../CallerAutoPilotControlManager.kt | 8 +++--- 5 files changed, 34 insertions(+), 20 deletions(-) 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) } } From a007bbf1303df6579a23159a597b0a4aee9cbbb1 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 24 May 2024 19:14:24 +0800 Subject: [PATCH 03/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E5=90=AF=E5=8A=A8Routing=E8=87=AA=E5=8A=A8=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt | 3 ++- .../och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt | 7 ++++++- .../java/com/mogo/och/taxi/ui/routing/TaxiRoutingModel.kt | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt index aa5fd325a5..d0ece766dd 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt @@ -11,7 +11,8 @@ data class GrayLineBean( var lineFailCount: Int?, //线路累计反馈不可用次数 var isChoosed: Boolean = false, //当前是否选中 var startSite: RoutingSite?, - var endSite: RoutingSite? + var endSite: RoutingSite?, + var isAutoRouting: Boolean = true, //是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹 ) data class RoutingSite( diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt index 501cc62945..807cdeafcd 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt @@ -32,7 +32,12 @@ class TaxiRoutingChooseLineAdapter( override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) { val currentPosition = holder.bindingAdapterPosition val data = mData[currentPosition] - holder.lineNameTextView.text = data.lineName + // 区分Routing和循迹 + holder.lineNameTextView.text = if (data.isAutoRouting) { + "Routing-" + data.lineName + } else { + data.lineName + } holder.todayVerifyNumTextView.text = "本车今日已验证:${data.carVerificationCount}次" holder.historyVerifyNumTextView.text = "路线累计反馈${data.lineSuccessCount}可用,${data.lineFailCount}不可用" 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 6db672f5ea..90cbe7943b 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,7 +492,8 @@ object TaxiRoutingModel { CallerLogger.e(TAG, "AutopilotControlParameters is empty.") return } - parameters.isAutoRouting = true + // 使用云端配置的Routing灰度路线 + parameters.isAutoRouting = grayLineBean.isAutoRouting OchAutoPilotManager.startAutoPilot(parameters); From 06c0366b4282380717a76b6aa32223af4b6b5764 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 27 May 2024 14:16:33 +0800 Subject: [PATCH 04/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2gradle=EF=BC=8Cmaven=E4=BB=A3=E7=90=86=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1https\://mirrors.tencent.com/gradle/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 55e1a2591e..27fa064374 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Sep 22 11:53:55 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://mirrors.tencent.com/gradle/gradle-6.1.1-all.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 1267d23bc1dbd0c6ff4a20a43907ad257ecce634 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 27 May 2024 18:02:00 +0800 Subject: [PATCH 05/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=81=B0=E5=BA=A6=E8=B7=AF=E7=BA=BF=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E6=B3=A8=E6=84=8F=20//TODO=20Routing=20?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E9=9C=80=E8=A6=81=E7=BB=9F=E4=B8=80=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=9C=9F=E5=AE=9E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt | 2 +- .../java/com/mogo/och/taxi/ui/routing/TaxiRoutingModel.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt index d0ece766dd..4f8514afb5 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt @@ -12,7 +12,7 @@ data class GrayLineBean( var isChoosed: Boolean = false, //当前是否选中 var startSite: RoutingSite?, var endSite: RoutingSite?, - var isAutoRouting: Boolean = true, //是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹 + var isAutoRouting: Boolean = true //是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹 ) data class RoutingSite( 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 90cbe7943b..97d3992f19 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 @@ -211,6 +211,10 @@ object TaxiRoutingModel { DebugView.printInfoMsg("[查询灰度路线] 请求success,dataSize=${data?.data?.size}") val result = mutableListOf() data.data?.also { + //TODO Routing 临时修改,这里后面从接口数据直接获取,需要配合运营平台一起修改灰度路线数据 + it.forEach { + it.isAutoRouting = true + } result.addAll(it) } mTaxiRoutingCallbackMap.forEach { From c51e4aa6b9b1d59fcbfd1dc491462c41c9630409 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 30 May 2024 17:54:25 +0800 Subject: [PATCH 06/10] =?UTF-8?q?[adas]=20routing=E9=9C=80=E6=B1=82?= =?UTF-8?q?=EF=BC=8C=E5=85=BC=E5=AE=B9=E8=87=AA=E5=8A=A8=E7=AE=97=E8=B7=AF?= =?UTF-8?q?=E5=92=8C=E8=BD=A8=E8=BF=B9=E7=AE=97=E8=B7=AF=20=E5=90=8C?= =?UTF-8?q?=E6=AD=A5PB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo-adas-data/src/main/proto/message_pad.proto | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index bbb60baffe..8ef978bc44 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -273,8 +273,7 @@ message TrajectoryDownloadReq uint32 source = 2; //指令来源: 0: default, 1:pad, 2:aicloud uint32 downloadType = 3; //下载类型: 0:正常下载 1:预下载 - bool isAutoRouting = 4; //20240523 是否进行自动算路 - RouteInfo routeInfo = 5; //20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! + RouteInfo routeInfo = 4; //20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!(Line信息重复) } // message definition for MessageType: MsgTypeBasicInfoReq @@ -316,11 +315,10 @@ message RouteInfo bool isSpeakVoice = 8; //abandoned uint32 routeID = 9; string routeName = 10; - Line line = 11; //路线信息 + Line line = 11; //路线信息,原有轨迹线路信息 - string newRoutingMd5 = 12; //20240523 默认空值"":原有轨迹线路;若存在有效MD5值,新算路信息 - repeated Location blackPoints = 13; //20240523 不让走的道路,异常线路点 - bool isRestart = 14; //20240523 用于表示判断是否是起点下单。默认false:起点下单, true: 中间站点下单 或者接管后重新启动 + repeated Location blackPoints = 12; //20240523 不让走的道路,异常线路点 + bool isStation = 13; //20240523 用于表示判断是否是站点下单。默认false:起点下单,接管下单; true: 中间站点下单 } message SetAutopilotModeReq @@ -329,7 +327,6 @@ message SetAutopilotModeReq uint32 source = 2; //命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) RouteInfo routeInfo = 3; //自动驾驶路径信息 - bool isAutoRouting = 4; //20240523 是否进行自动算路 } // message definition for MsgTypeSetDemoModeReq From 03c922249af75142dd422e61dad10a5eff2da58e Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 31 May 2024 14:17:23 +0800 Subject: [PATCH 07/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4isAutoRouting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/taxi/bean/TaxiRoutingBean.kt | 3 +-- .../routing/TaxiRoutingChooseLineAdapter.kt | 6 +----- .../och/taxi/ui/routing/TaxiRoutingModel.kt | 6 ------ .../autopilot/MoGoAutopilotControlProvider.kt | 21 +++++++++---------- .../autopilot/AutopilotControlParameters.kt | 4 +--- .../IMoGoAutopilotControlProvider.kt | 5 ++--- .../CallerAutoPilotControlManager.kt | 8 +++---- .../zhidao/support/adas/high/AdasChannel.java | 8 ++----- .../zhidao/support/adas/high/AdasManager.java | 15 ++++++------- .../support/adas/high/IAdasNetCommApi.java | 6 ++---- 10 files changed, 29 insertions(+), 53 deletions(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt index 4f8514afb5..aa5fd325a5 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt @@ -11,8 +11,7 @@ data class GrayLineBean( var lineFailCount: Int?, //线路累计反馈不可用次数 var isChoosed: Boolean = false, //当前是否选中 var startSite: RoutingSite?, - var endSite: RoutingSite?, - var isAutoRouting: Boolean = true //是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹 + var endSite: RoutingSite? ) data class RoutingSite( diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt index 807cdeafcd..828a8e4416 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt @@ -33,11 +33,7 @@ class TaxiRoutingChooseLineAdapter( val currentPosition = holder.bindingAdapterPosition val data = mData[currentPosition] // 区分Routing和循迹 - holder.lineNameTextView.text = if (data.isAutoRouting) { - "Routing-" + data.lineName - } else { - data.lineName - } + holder.lineNameTextView.text = data.lineName holder.todayVerifyNumTextView.text = "本车今日已验证:${data.carVerificationCount}次" holder.historyVerifyNumTextView.text = "路线累计反馈${data.lineSuccessCount}可用,${data.lineFailCount}不可用" 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 97d3992f19..2392b26090 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 @@ -211,10 +211,6 @@ object TaxiRoutingModel { DebugView.printInfoMsg("[查询灰度路线] 请求success,dataSize=${data?.data?.size}") val result = mutableListOf() data.data?.also { - //TODO Routing 临时修改,这里后面从接口数据直接获取,需要配合运营平台一起修改灰度路线数据 - it.forEach { - it.isAutoRouting = true - } result.addAll(it) } mTaxiRoutingCallbackMap.forEach { @@ -496,8 +492,6 @@ object TaxiRoutingModel { CallerLogger.e(TAG, "AutopilotControlParameters is empty.") return } - // 使用云端配置的Routing灰度路线 - parameters.isAutoRouting = grayLineBean.isAutoRouting 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 95bfb3c1e0..2f333858e5 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 @@ -388,12 +388,12 @@ class MoGoAutopilotControlProvider : private fun startAutoPilotWithNoParameter(source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, null, false) + .sendAutoPilotModeReq(1, source, null) invokeAutoPilotResult(if (invokeResult > -1) "无参自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, null, false) + .sendAutoPilotModeReq(1, source, null) invokeAutoPilotResult(if (invokeResult > -1) "无参自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶 无参") @@ -405,12 +405,12 @@ class MoGoAutopilotControlProvider : private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.isAutoRouting) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo()) 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(), controlParameters.isAutoRouting) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo()) invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶") @@ -446,21 +446,20 @@ class MoGoAutopilotControlProvider : ) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) { - AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(),isAutoRouting,routeInfo) + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, routeInfo: MessagePad.RouteInfo?) { + AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(),routeInfo) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) { + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, routeInfo: MessagePad.RouteInfo?) { AdasManager.getInstance().sendTrajectoryDownloadReq( autoPilotLine.toAutoPilotLine(), downloadType, - isAutoRouting, routeInfo) } override fun cancelAutoPilot() { if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) { - AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null, false) + AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null) } else { CallerLogger.e("$M_D_C$TAG", "车机与工控机链接失败,无法断开自动驾驶") } @@ -930,11 +929,11 @@ class MoGoAutopilotControlProvider : */ override fun setControlAutopilotCarAuto(isEnable: Boolean) { if (isEnable) { - AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null, false) + AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null) } else { // 司机屏才可关闭自动驾驶 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null, false) + AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null) } } } 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 ac94b2a76c..58f9e37cf3 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,7 +139,6 @@ class AutopilotControlParameters { @JvmField var autoPilotLine: AutoPilotLine? = null // 自动驾驶路线 - var isAutoRouting = false//是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹 class AutoPilotLine { var lineId = 0L @@ -229,8 +228,7 @@ class AutopilotControlParameters { "routeID=$routeID, " + "routeName='$routeName', " + "isSpeakVoice=$isSpeakVoice, " + - "autoPilotLine=$autoPilotLine, " + - "isAutoRouting=$isAutoRouting)" + "autoPilotLine=$autoPilotLine)" } 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 5b6755b01e..121840c7d7 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,17 +56,16 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { /** * 发送 轨迹下载请求 */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) + fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, routeInfo: MessagePad.RouteInfo?) /** * 发送 轨迹下载请求 * * @param autoPilotLine 线路相关参数详情见PB message_pad.proto -> Line * @param downloadType 下载类型: 0:正常下载 1:预下载 - * @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, 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 96befaeb27..627f2e4fad 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 Routing 需要传参 isAutoRouting, routeInfo - providerApi?.sendTrajectoryDownloadReq(autoPilotLine, false, null) + //TODO Routing 需要传参 routeInfo + providerApi?.sendTrajectoryDownloadReq(autoPilotLine, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0) } } @@ -194,8 +194,8 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - //TODO Routing 需要传参 isAutoRouting, routeInfo - providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, false, null) + //TODO Routing 需要传参 routeInfo + providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType) } } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java index f3d0c82a56..b57759ce9a 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java @@ -1192,20 +1192,18 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec * @param mode 1: enter autopilot mode, 0: quit autopilot mode * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) * @param routeInfo 自动驾驶路径信息 - * @param isAutoRouting 20240523 是否进行自动算路 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ @Override - public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo, boolean isAutoRouting) { + public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo) { MessagePad.SetAutopilotModeReq.Builder builder = MessagePad.SetAutopilotModeReq.newBuilder(); builder.setMode(mode); builder.setSource(source); if (routeInfo != null) builder.setRouteInfo(routeInfo); - builder.setIsAutoRouting(isAutoRouting); MessagePad.SetAutopilotModeReq req = builder.build(); if (autopilotReview != null) autopilotReview.onAutopilotCommandTrigger(req); return sendPBMessage(MessageType.TYPE_SEND_SET_AUTOPILOT_MODE_REQ, req.toByteArray()); @@ -1659,7 +1657,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec * * @param line 线路相关参数详情见PB message_pad.proto -> Line * @param downloadType 下载类型: 0:正常下载 1:预下载 - * @param isAutoRouting 20240523 是否进行自动算路 * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 @@ -1673,7 +1670,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec paramIndexes = {0} ) @Override - public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, boolean isAutoRouting, MessagePad.RouteInfo routeInfo) { + public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, MessagePad.RouteInfo routeInfo) { MessagePad.TrajectoryDownloadReq.Builder builder = MessagePad.TrajectoryDownloadReq.newBuilder(); builder.setSource(1);//指令来源: 0: default, 1:pad, 2:aicloud if (line != null) { @@ -1682,7 +1679,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec if (downloadType > -1) { builder.setDownloadType(downloadType); } - builder.setIsAutoRouting(isAutoRouting); if (routeInfo != null) { builder.setRouteInfo(routeInfo); } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java index 7f9669cdf3..8ac84e549d 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java @@ -396,15 +396,14 @@ public class AdasManager implements IAdasNetCommApi { * @param mode 1: enter autopilot mode, 0: quit autopilot mode * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) * @param routeInfo 自动驾驶路径信息 - * @param isAutoRouting 20240523 是否进行自动算路 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ @Override - public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo, boolean isAutoRouting) { - return mChannel == null ? -1L : mChannel.sendAutoPilotModeReq(mode, source, routeInfo, isAutoRouting); + public long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo) { + return mChannel == null ? -1L : mChannel.sendAutoPilotModeReq(mode, source, routeInfo); } /** @@ -760,15 +759,14 @@ public class AdasManager implements IAdasNetCommApi { * 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck * * @param line 线路相关参数详情见PB message_pad.proto -> Line - * @param isAutoRouting 20240523 是否进行自动算路 * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ - public long sendTrajectoryDownloadReq(MessagePad.Line line, boolean isAutoRouting, MessagePad.RouteInfo routeInfo) { - return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1, isAutoRouting, routeInfo); + public long sendTrajectoryDownloadReq(MessagePad.Line line, MessagePad.RouteInfo routeInfo) { + return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1, routeInfo); } /** @@ -777,7 +775,6 @@ public class AdasManager implements IAdasNetCommApi { * * @param line 线路相关参数详情见PB message_pad.proto -> Line * @param downloadType 下载类型: 0:正常下载 1:预下载 - * @param isAutoRouting 20240523 是否进行自动算路 * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 @@ -785,8 +782,8 @@ public class AdasManager implements IAdasNetCommApi { * * -1L:添加到WS发送消息队列失败 */ @Override - public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, boolean isAutoRouting, MessagePad.RouteInfo routeInfo) { - return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, downloadType, isAutoRouting, routeInfo); + public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, MessagePad.RouteInfo routeInfo) { + return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, downloadType, routeInfo); } /** diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java index 557e3f4447..ed05195d5c 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java @@ -176,13 +176,12 @@ public interface IAdasNetCommApi { * @param mode 1: enter autopilot mode, 0: quit autopilot mode * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) * @param routeInfo 自动驾驶路径信息 - * @param isAutoRouting 20240523 是否进行自动算路 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ - long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo, boolean isAutoRouting); + long sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo); /** @@ -478,14 +477,13 @@ public interface IAdasNetCommApi { * * @param line 线路相关参数详情见PB message_pad.proto -> Line * @param downloadType 下载类型: 0:正常下载 1:预下载 - * @param isAutoRouting 20240523 是否进行自动算路 * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 * * -1L:添加到WS发送消息队列失败 */ - long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, boolean isAutoRouting, MessagePad.RouteInfo routeInfo); + long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, MessagePad.RouteInfo routeInfo); /** * 发送 状态查询请求 From 71139f9c9ab88644af014be7c14f1c6b04bb6816 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 3 Jun 2024 19:30:05 +0800 Subject: [PATCH 08/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/taxi/callback/ITaxiRoutingCallback.kt | 45 +++++++++++++++++++ .../taxi/network/TaxiRoutingServiceManager.kt | 3 ++ .../mogo/och/taxi/ui/base/TaxiPresenter.java | 3 ++ .../routing/TaxiRoutingChooseLineActivity.kt | 3 ++ .../routing/TaxiRoutingChooseLineAdapter.kt | 2 +- .../taxi/ui/routing/TaxiRoutingFragment.kt | 7 +++ .../routing/TaxiRoutingFragmentViewModel.kt | 1 + .../och/taxi/ui/routing/TaxiRoutingModel.kt | 32 ++++++++++++- 8 files changed, 93 insertions(+), 3 deletions(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/callback/ITaxiRoutingCallback.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/callback/ITaxiRoutingCallback.kt index 22fcb34e93..df310b978f 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/callback/ITaxiRoutingCallback.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/callback/ITaxiRoutingCallback.kt @@ -4,14 +4,59 @@ import com.mogo.och.taxi.bean.GrayLineBean import com.mogo.och.taxi.bean.StartGrayAndQueryContrailRsp interface ITaxiRoutingCallback { + /** + * 查询灰度路线列表--成功✅ + */ fun onQueryRoutingGrayLineListSuccess(data: MutableList) + + /** + * 查询灰度路线列表--失败❌ + * @param errorStr 错误信息 + */ fun onQueryRoutingGrayLineListFailed(errorStr: String) + + /** + * 灰度任务&查询轨迹详情--成功✅ + */ fun onStartGrayTaskAndQueryContrailSuccess(data: StartGrayAndQueryContrailRsp) + + /** + * 灰度任务&查询轨迹详情--失败❌ + * @param errorStr 错误信息 + */ fun onStartGrayTaskAndQueryContrailFailed(errorStr: String) + + /** + * 灰度任务过程中,上报问题打点--成功✅ + */ fun onSubmitGrayLineIssueLocationSuccess() + + /** + * 灰度任务过程中,上报问题打点--失败❌ + * @param errorStr 错误信息 + */ fun onSubmitGrayLineIssueLocationFailed(errorStr: String) + + /** + * 结束灰度任务--成功✅ + */ fun onSubmitEndTaskSuccess() + + /** + * 结束灰度任务--成功❌ + * @param errorStr 错误信息 + */ fun onSubmitEndTaskFailed(errorStr: String) + + /** + * MAP到站通知 + * @param grayId 灰度路线ID + */ fun onAutoPilotArriveAtEndStation(grayId: Long?) + + /** + * 自车定位围栏 + * @param grayId 灰度路线ID + */ fun onGDMapArriveAtEndStation(grayId: Long?) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/network/TaxiRoutingServiceManager.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/network/TaxiRoutingServiceManager.kt index 0d1377a6cf..fe8caf97af 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/network/TaxiRoutingServiceManager.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/network/TaxiRoutingServiceManager.kt @@ -105,6 +105,9 @@ object TaxiRoutingServiceManager { .subscribe(OchCommonSubscribeImpl(context, callback, "dot/list")) } + /** + * 标记灰度任务被启动验证 + */ fun startGrayTaskAndQueryRoutingContrail( context: Context, sn: String, diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java index 3f0c3169f4..8cf65e5a50 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java @@ -73,9 +73,12 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS * 开启自动驾驶 自驾模式 */ public void startAutoPilot() { + // 这里区分是订单还是灰度测试 if (MogoStatusManager.getInstance().isTaxiUnmanedDriverLineRoutingVerifyMode()) { + // 灰度测试 TaxiRoutingModel.INSTANCE.startAutoPilotByClick(); } else { + // 订单 TaxiTaskModel.INSTANCE.startAutopilotByClick(); } } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt index e9c72c0f2a..4514f3b265 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt @@ -90,6 +90,8 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { btnClose.setOnClickListener { finish() } + + // 选择路线后,「确认」按钮 btnChooseLineSubmit.setOnClickListener { if (mCurrentChosenPosition == -1) { ToastUtils.showLong("请先选择任务") @@ -99,6 +101,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { mLoadingDialog.showLoading() val chosenItem = mRoutingLineList[mCurrentChosenPosition] mViewModel.sendUiIntent( + // 调用查询接口获取路线详情 TaxiRoutingUiIntent.StartTaskAndQueryContrail(chosenItem) ) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt index 828a8e4416..8c0813955b 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt @@ -32,7 +32,7 @@ class TaxiRoutingChooseLineAdapter( override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) { val currentPosition = holder.bindingAdapterPosition val data = mData[currentPosition] - // 区分Routing和循迹 + holder.lineNameTextView.text = data.lineName holder.todayVerifyNumTextView.text = "本车今日已验证:${data.carVerificationCount}次" holder.historyVerifyNumTextView.text = diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt index da83878c81..9f95ea75b7 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt @@ -122,6 +122,9 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback { } } + /** + * 展示选择任务视图 + */ private fun showChooseTaskView() { noDataContainer.visibility = View.VISIBLE mCurrentTaskLayout.visibility = View.GONE @@ -134,6 +137,9 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback { removeAllMapMarker() } + /** + * 展示当前路线任务信息 + */ private fun showCurrentLineTaskContentView(data: RoutingUIState.RoutingTask) { noDataContainer.visibility = View.GONE mCurrentTaskLayout.visibility = View.VISIBLE @@ -143,6 +149,7 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback { btnChooseTask.visibility = View.GONE btnStartTask.visibility = View.VISIBLE + // 开始任务,按钮 btnStartTask.setOnClickListener { mViewModel.sendUiIntent(TaxiRoutingUiIntent.StartTaskAction(data)) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt index b8436acf82..292c3eca79 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt @@ -59,6 +59,7 @@ class TaxiRoutingFragmentViewModel : BaseViewModel { DebugView.printInfoMsg("[开始任务] 准备开始任务") val grayLineBean = intent.routingTask.grayLineBean 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..41421c3cbe 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 @@ -88,7 +88,9 @@ object TaxiRoutingModel { OchAutoPilotStatusListenerManager.removeListener(TAG) } - //MAP到站监听 + /** + * MAP到站监听 + */ private val mMogoAutopilotStatusListener: IOchAutopilotStatusListener = object : IOchAutopilotStatusListener { @@ -128,7 +130,9 @@ object TaxiRoutingModel { } } - // 自车定位监听 + /** + * 自车定位监听 + */ private val mMapLocationListener: IMoGoChassisLocationGCJ02Listener = object : IMoGoChassisLocationGCJ02Listener { override fun onChassisLocationGCJ02(currentLocation: MogoLocation?) { @@ -199,6 +203,9 @@ object TaxiRoutingModel { CallerChassisLocationGCJ02ListenerManager.removeListener(TAG) } + /** + * 查询灰度路线 + */ fun queryRoutingGrayLineList() { DebugView.printInfoMsg("[查询灰度路线] 准备发送请求,sn=${SharedPrefsMgr.getInstance().sn}") TaxiRoutingServiceManager.queryRoutingGrayLineList(mContext, @@ -255,6 +262,9 @@ object TaxiRoutingModel { }) } + /** + * 开始灰度任务&查询轨迹详情 + */ fun startGrayTaskAndQueryRoutingContrail(contrailId: Long, grayLineBean: GrayLineBean) { DebugView.printInfoMsg("[开始灰度任务&查询轨迹详情] 准备发送请求,contrailId=${contrailId}, lineId=${grayLineBean.lineId}") TaxiRoutingServiceManager.startGrayTaskAndQueryRoutingContrail( @@ -275,6 +285,7 @@ object TaxiRoutingModel { DebugView.printInfoMsg("[开始灰度任务&查询轨迹详情] 请求success,taskId=${data.taskId}, contrailId=${contrailId}, lineId=${grayLineBean.lineId}") mTaxiRoutingCallbackMap.forEach { val listener = it.value + //TODO Routing 从这里解析出经停信息,并和订单一样调用下载轨迹接口 listener.onStartGrayTaskAndQueryContrailSuccess(data) } } @@ -315,6 +326,9 @@ object TaxiRoutingModel { ) } + /** + * 灰度任务过程中,上报问题打点 + */ fun submitGrayLineIssueLocation(grayId: Long, gcjLon: Double, gcjLat: Double) { DebugView.printInfoMsg("[上报打点] 准备发送请求,grayId=$grayId, gcjLon=$gcjLon, gcjLat=$gcjLat") val submit = SubmitGrayLineIssueLocationReq(grayId, gcjLon, gcjLat) @@ -374,6 +388,9 @@ object TaxiRoutingModel { ) } + /** + * 结束灰度任务 + */ fun endGrayTask(grayId: Long, type: EndGrayTaskFeedbackType, occurrenceTime:Long,) { DebugView.printInfoMsg("[结束灰度任务] 准备发送请求,grayId=$grayId, type=${type.type}, typeName=${type.name}") val submit = EndGrayContrailTaskReq(grayId, type.type,occurrenceTime) @@ -432,6 +449,9 @@ object TaxiRoutingModel { }) } + /** + * 更新灰度路线信息 + */ fun updateCurrentGrayLineAndContrail( grayLineBean: GrayLineBean?, contrailBean: ContrailBean?, @@ -442,6 +462,9 @@ object TaxiRoutingModel { currentGrayId = grayId } + /** + * 灰度测试路线,启动自动驾驶 + */ fun startAutoPilotByClick() { if (currentGrayLineBean == null || currentContrailBean == null) { CallerLogger.e( @@ -454,6 +477,9 @@ object TaxiRoutingModel { startAutoPilot(currentGrayLineBean!!, currentContrailBean!!) } + /** + * 启动自动驾驶 + */ fun startAutoPilot(grayLineBean: GrayLineBean, contrailBean: ContrailBean) { if (grayLineBean.startSite == null || grayLineBean.endSite == null) { CallerLogger.e(TAG, "start site or end site is null") @@ -487,12 +513,14 @@ object TaxiRoutingModel { return } + // 初始化自动驾驶需要的参数 val parameters = initAutopilotControlParameters(grayLineBean, contrailBean) if (null == parameters) { CallerLogger.e(TAG, "AutopilotControlParameters is empty.") return } + // 开启自动驾驶 OchAutoPilotManager.startAutoPilot(parameters); DebugView.printInfoMsg("[启自驾] 调用成功") From ade4b8a9a83c8bec3967018e06bb017a71bd922c Mon Sep 17 00:00:00 2001 From: donghongyu Date: Wed, 12 Jun 2024 17:25:38 +0800 Subject: [PATCH 09/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E7=81=B0?= =?UTF-8?q?=E5=BA=A6=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0RoutingRequest?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E9=80=8F=E4=BC=A0=E7=BB=99MAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/taxi/bean/TaxiRoutingBean.kt | 76 +++++++++++++++--- .../routing/TaxiRoutingChooseLineActivity.kt | 5 ++ .../routing/TaxiRoutingChooseLineViewModel.kt | 3 + .../och/taxi/ui/routing/TaxiRoutingModel.kt | 80 +++++++++++++++++-- .../och/taxi/ui/routing/TaxiRoutingUiState.kt | 3 + .../autopilot/AutopilotControlParameters.kt | 6 +- .../CallerAutoPilotControlManager.kt | 17 +++- 7 files changed, 172 insertions(+), 18 deletions(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt index aa5fd325a5..fe4b2a391b 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt @@ -2,6 +2,9 @@ package com.mogo.och.taxi.bean import com.mogo.eagle.core.data.BaseData +/** + * 灰度路线信息 + */ data class GrayLineBean( var lineId: Long?, //线路id var lineName: String?, //线路名称 @@ -11,18 +14,30 @@ data class GrayLineBean( var lineFailCount: Int?, //线路累计反馈不可用次数 var isChoosed: Boolean = false, //当前是否选中 var startSite: RoutingSite?, - var endSite: RoutingSite? + var endSite: RoutingSite?, + var hdMapDBVersionCode: String?,// Routing 运营平台通过算路引擎算这条路时候使用的对应高精地图版本号 + var hdMapDBVersionName: String?,// Routing 运营平台通过算路引擎算这条路时候使用的对应高精地图版本名 + var routingEnginVersionCode: String?,// Routing 运营平台当前的算路引擎版本号码 + var routingEnginVersionName: String?,// Routing 运营平台当前的算路引擎版本名称 + var wayPoints: MutableList?,// Routing 给算路引擎使用的经停点列表,不是真正的要停车 + var blackPoints: MutableList?// Routing 给算路引擎使用的黑名单点,目的是不参与算路 ) +/** + * 站点信息 + */ data class RoutingSite( - var siteId: Long, - var siteName: String, - var gcjLat: Double, - var gcjLon: Double, - var wgs84Lon: Double, - var wgs84Lat: Double + var siteId: Long,// 站点ID + var siteName: String,// 站点名称 + var gcjLat: Double,// 高德坐标 + var gcjLon: Double,// 高德坐标 + var wgs84Lon: Double,//高精坐标 + var wgs84Lat: Double//高精坐标 ) +/** + * 轨迹信息 + */ data class ContrailBean( var lineId: Long = -1L, var lineName: String = "", @@ -40,29 +55,70 @@ data class ContrailBean( var version: Long = -1L ) +/** + * 查询灰度线路列表 + */ data class QueryGrayContrailListRsp(var data: MutableList?) : BaseData() + +/** + * 通过id查询轨迹详情 + */ data class StartGrayContrailTaskReq(var sn: String, var contrailId: Long) + +/** + * 开始一个路线的灰度任务,对服务端的路线标记 + */ data class StartGrayContrailTaskRsp(var data: Long?) : BaseData() + +/** + * 根据id查询灰度轨迹详情 + */ data class QueryRoutingContrailByIdRsp(var data: ContrailBean?) : BaseData() + +/** + * 上报路线打点 + */ data class SubmitGrayLineIssueLocationReq(var grayId: Long, var gcjLon: Double, var gcjLat: Double) -data class EndGrayContrailTaskReq(var grayId: Long, var feedback: Int,var occurrenceTime:Long) //feedback 1:成功 2:失败 + +/** + * 结束一个路线的灰度任务 + */ +data class EndGrayContrailTaskReq( + var grayId: Long, + var feedback: Int, + var occurrenceTime: Long +) //feedback 1:成功 2:失败 + + +/** + * 灰度任务&查询轨迹详情 + */ data class StartGrayAndQueryContrailRsp( var taskId: Long?, var contrail: ContrailBean?, var grayLineBean: GrayLineBean ) : BaseData() -data class PointError(var code:String,var name:String,var isCheck:Boolean = false) +data class PointError(var code: String, var name: String, var isCheck: Boolean = false) + +/** + * 获取打点问题字典 + */ data class QueryPointErrorReasonsRsp(var data: MutableList?) : BaseData() + +/** + * 结束一个路线的灰度任务,并上报灰度路线测试情况 + */ data class SaveGrayContrailErrorReasons( var grayId: Long, var gcjLon: Double, var gcjLat: Double, var wgs84Lon: Double, var wgs84Lat: Double, - var occurrenceTime:Long, + var occurrenceTime: Long, var noteCodes: MutableList, ) //feedback 1:成功 2:失败 + enum class EndGrayTaskFeedbackType(var type: Int) { USABLE_YES(1), USABLE_NO(2) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt index 4514f3b265..b9e8894048 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt @@ -107,6 +107,9 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { } } + /** + * 初始化UI观察者 + */ private fun initViewModelObserver() { lifecycleScope.launchWhenStarted { mViewModel.uiStateFlow.map { it.routingUiState }.collect { routingUiState -> @@ -114,6 +117,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { TAG, "uiStateFlow-initViewModelObserver: $routingUiState" ) + // 分发处理具体UI更新 when (routingUiState) { is RoutingUIState.Init -> { showEmptyView() @@ -131,6 +135,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { } } + // 将结果同步更新到UI is RoutingUIState.PostRoutingTaskResult -> { FlowBus.with(TaxiDriverEventConst.RoutingActivityEvent.EVENT_TYPE_GET_CHOSEN_LINE_TASK) .post(this, RoutingUIState.RoutingTask( diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt index f6f733248e..f69a3b5f2b 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt @@ -56,6 +56,9 @@ class TaxiRoutingChooseLineViewModel : BaseViewModel + // 初始化自动驾驶需要的参数 + val parameters = initAutopilotControlParameters( + startGrayAndQueryContrailRsp.grayLineBean, + contrail + ) + + if (parameters!!.autoPilotLine == null) { + CallerLogger.e( + SceneConstant.M_BUS + TAG, + "sendTrajectoryReq(): mAutoPilotLine is null!!!" + ) + return + } + writeChainLog( + "轨迹监控", + "sendTrajectoryReq() 下发轨迹 轨迹id" + parameters.autoPilotLine!!.lineId, + true, + OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY + ) + CallerAutoPilotControlManager.sendTrajectoryDownloadReq(parameters) + CallerLogger.d( + SceneConstant.M_BUS + TAG, + "sendTrajectoryReq(): " + + GsonUtils.toJson(parameters) + ) + } + } + /** * 更新灰度路线信息 */ @@ -521,7 +558,7 @@ object TaxiRoutingModel { } // 开启自动驾驶 - OchAutoPilotManager.startAutoPilot(parameters); + OchAutoPilotManager.startAutoPilot(parameters) DebugView.printInfoMsg("[启自驾] 调用成功") CallerLogger.d( @@ -531,6 +568,9 @@ object TaxiRoutingModel { mControllerStatusCallback?.startOpenAutopilot() } + /** + * 初始化自动驾驶控制参数 + */ private fun initAutopilotControlParameters( grayLineBean: GrayLineBean, contrailBean: ContrailBean @@ -548,6 +588,36 @@ object TaxiRoutingModel { parameters.startLatLon = AutopilotControlParameters.AutoPilotLonLat(startWgsLat, startWgsLon) parameters.endLatLon = AutopilotControlParameters.AutoPilotLonLat(endWgsLat, endWgsLon) + + // Routing 给算路引擎使用的:经停点列表、黑名单 + val wayLatLons: MutableList = ArrayList() + val blackLatLons: MutableList = ArrayList() + + if (!grayLineBean.wayPoints.isNullOrEmpty()) { + for (mogoLatLng in grayLineBean.wayPoints!!) { + wayLatLons.add( + AutopilotControlParameters.AutoPilotLonLat( + mogoLatLng.wgs84Lat, + mogoLatLng.wgs84Lon + ) + ) + } + } + + if (!grayLineBean.blackPoints.isNullOrEmpty()) { + for (mogoLatLng in grayLineBean.blackPoints!!) { + wayLatLons.add( + AutopilotControlParameters.AutoPilotLonLat( + mogoLatLng.wgs84Lat, + mogoLatLng.wgs84Lon + ) + ) + } + } + + parameters.wayLatLons = wayLatLons + parameters.blackLatLons = blackLatLons + if (parameters.autoPilotLine == null) { parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine( contrailBean.lineId, diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingUiState.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingUiState.kt index 9aef55856b..8be6e8e374 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingUiState.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingUiState.kt @@ -6,6 +6,9 @@ import com.mogo.och.taxi.bean.GrayLineBean data class TaxiRoutingUiState(val routingUiState: RoutingUIState) : IUiState +/** + * 算路UI状态 + */ sealed class RoutingUIState { object Init : RoutingUIState() 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 58f9e37cf3..7fcc66a5f9 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 @@ -113,7 +113,10 @@ class AutopilotControlParameters { var startLatLon: AutoPilotLonLat? = null @JvmField - var wayLatLons: List? = null + var wayLatLons: List? = null // Routing 给算路引擎使用的经停点列表,不是真正的要停车 + + @JvmField + var blackLatLons: List? = null // Routing 给算路引擎使用的黑名单点,目的是不参与算路 @JvmField var endLatLon: AutoPilotLonLat? = null @@ -222,6 +225,7 @@ class AutopilotControlParameters { "endName='$endName', " + "startLatLon=$startLatLon, " + "wayLatLons=$wayLatLons," + + "blackLatLons=$blackLatLons," + "endLatLon=$endLatLon," + "speedLimit=$speedLimit, " + "vehicleType=$vehicleType, " + 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 627f2e4fad..227630c0c2 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 @@ -4,6 +4,8 @@ import android.os.SystemClock import chassis.SpecialVehicleTaskCmdOuterClass import com.mogo.commons.voice.AIAssist 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.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths @@ -177,12 +179,23 @@ object CallerAutoPilotControlManager { } } + /** + * 发送 轨迹下载请求 + */ + fun sendTrajectoryDownloadReq(autopilotControlParameters: AutopilotControlParameters) { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + // Routing 需要传参 routeInfo + providerApi?.sendTrajectoryDownloadReq(autopilotControlParameters.autoPilotLine!!, autopilotControlParameters.toRouteInfo()) + CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autopilotControlParameters.autoPilotLine!!, 0) + } + } + /** * 发送 轨迹下载请求 */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - //TODO Routing 需要传参 routeInfo + //TODO Routing 需要传参 routeInfo,这里建议业务侧重新整合到同一个数据实体内传入 providerApi?.sendTrajectoryDownloadReq(autoPilotLine, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0) } @@ -194,7 +207,7 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - //TODO Routing 需要传参 routeInfo + //TODO Routing 需要传参 routeInfo,这里建议业务侧重新整合到同一个数据实体内传入 providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType) } From 88f73c5fd7f75335ee968e5bf965c07867606be5 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 21 Jun 2024 20:17:47 +0800 Subject: [PATCH 10/10] =?UTF-8?q?[Routing=20dev]=201=E3=80=81=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E7=BB=8F=E5=81=9C=E7=82=B9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt index fe4b2a391b..80f5543b0d 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/bean/TaxiRoutingBean.kt @@ -52,7 +52,8 @@ data class ContrailBean( var txtFileUrlDPQP: String = "", var txtFileMd5DPQP: String = "", var contrailSaveTimeDPQP: Long = -1L, - var version: Long = -1L + var version: Long = -1L, + var passPoints: MutableList?, // 用于算路的经停点 ) /**