diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiRoutingBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiRoutingBean.kt index 26eff72bf6..e13446132e 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiRoutingBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiRoutingBean.kt @@ -2,6 +2,9 @@ package com.mogo.och.unmanned.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 = "", @@ -37,32 +52,74 @@ data class ContrailBean( var txtFileUrlDPQP: String = "", var txtFileMd5DPQP: String = "", var contrailSaveTimeDPQP: Long = -1L, - var version: Long = -1L + var version: Long = -1L, + var passPoints: MutableList?, // 用于算路的经停点 ) +/** + * 查询灰度线路列表 + */ 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/unmanned/taxi/callback/ITaxiRoutingCallback.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiRoutingCallback.kt index aa61832b16..639dc98d64 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiRoutingCallback.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiRoutingCallback.kt @@ -4,14 +4,59 @@ import com.mogo.och.unmanned.taxi.bean.GrayLineBean import com.mogo.och.unmanned.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/unmanned/taxi/network/TaxiRoutingServiceManager.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/network/TaxiRoutingServiceManager.kt index 440de1898e..d7be74f6e9 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/network/TaxiRoutingServiceManager.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/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/unmanned/taxi/ui/base/TaxiPresenter.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java index 49e6dd146d..9c2ba726c7 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java @@ -76,9 +76,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/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt index 6b2d3310d6..b603912edf 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt @@ -90,6 +90,8 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { btnClose.setOnClickListener { finish() } + + // 选择路线后,「确认」按钮 btnChooseLineSubmit.setOnClickListener { if (mCurrentChosenPosition == -1) { ToastUtils.showLong("请先选择任务") @@ -99,11 +101,15 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { mLoadingDialog.showLoading() val chosenItem = mRoutingLineList[mCurrentChosenPosition] mViewModel.sendUiIntent( + // 调用查询接口获取路线详情 TaxiRoutingUiIntent.StartTaskAndQueryContrail(chosenItem) ) } } + /** + * 初始化UI观察者 + */ private fun initViewModelObserver() { lifecycleScope.launchWhenStarted { mViewModel.uiStateFlow.map { it.routingUiState }.collect { routingUiState -> @@ -111,6 +117,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { TAG, "uiStateFlow-initViewModelObserver: $routingUiState" ) + // 分发处理具体UI更新 when (routingUiState) { is RoutingUIState.Init -> { showEmptyView() @@ -128,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/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt index 97eb4bf2b5..43d87d496f 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt @@ -32,6 +32,7 @@ class TaxiRoutingChooseLineAdapter( override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) { val currentPosition = holder.bindingAdapterPosition val data = mData[currentPosition] + 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/unmanned/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt index 62869d5bf7..777c04dc31 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineViewModel.kt @@ -56,6 +56,9 @@ class TaxiRoutingChooseLineViewModel : BaseViewModel { DebugView.printInfoMsg("[开始任务] 准备开始任务") val grayLineBean = intent.routingTask.grayLineBean diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingModel.kt index 293cd6f607..eebe7d71aa 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingModel.kt @@ -19,12 +19,14 @@ import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.NetworkUtils import com.mogo.eagle.core.utilcode.util.ToastUtils -import com.mogo.och.common.module.network.OchCommonServiceCallback import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager +import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager +import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager.writeChainLog +import com.mogo.och.common.module.network.OchCommonServiceCallback import com.mogo.och.common.module.utils.OCHThreadPoolManager import com.mogo.och.unmanned.taxi.bean.ContrailBean import com.mogo.och.unmanned.taxi.bean.EndGrayContrailTaskReq @@ -88,7 +90,9 @@ object TaxiRoutingModel { OchAutoPilotStatusListenerManager.removeListener(TAG) } - //MAP到站监听 + /** + * MAP到站监听 + */ private val mMogoAutopilotStatusListener: IOchAutopilotStatusListener = object : IOchAutopilotStatusListener { @@ -128,7 +132,9 @@ object TaxiRoutingModel { } } - // 自车定位监听 + /** + * 自车定位监听 + */ private val mMapLocationListener: IMoGoChassisLocationGCJ02Listener = object : IMoGoChassisLocationGCJ02Listener { override fun onChassisLocationGCJ02(currentLocation: MogoLocation?) { @@ -199,6 +205,9 @@ object TaxiRoutingModel { CallerChassisLocationGCJ02ListenerManager.removeListener(TAG) } + /** + * 查询灰度路线 + */ fun queryRoutingGrayLineList() { DebugView.printInfoMsg("[查询灰度路线] 准备发送请求,sn=${SharedPrefsMgr.getInstance().sn}") TaxiRoutingServiceManager.queryRoutingGrayLineList(mContext, @@ -255,6 +264,9 @@ object TaxiRoutingModel { }) } + /** + * 开始灰度任务&查询轨迹详情 + */ fun startGrayTaskAndQueryRoutingContrail(contrailId: Long, grayLineBean: GrayLineBean) { DebugView.printInfoMsg("[开始灰度任务&查询轨迹详情] 准备发送请求,contrailId=${contrailId}, lineId=${grayLineBean.lineId}") TaxiRoutingServiceManager.startGrayTaskAndQueryRoutingContrail( @@ -276,6 +288,9 @@ object TaxiRoutingModel { mTaxiRoutingCallbackMap.forEach { val listener = it.value listener.onStartGrayTaskAndQueryContrailSuccess(data) + + // Routing 从这里解析出经停信息,轨迹信息,并调用下载轨迹接口 + sendTrajectoryReq(data) } } @@ -315,6 +330,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,9 +392,12 @@ object TaxiRoutingModel { ) } - fun endGrayTask(grayId: Long, type: EndGrayTaskFeedbackType, occurrenceTime:Long,) { + /** + * 结束灰度任务 + */ + 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) + val submit = EndGrayContrailTaskReq(grayId, type.type, occurrenceTime) TaxiRoutingServiceManager.endGrayTask( mContext, submit, @@ -432,6 +453,42 @@ object TaxiRoutingModel { }) } + /** + * 下载路线请求 + */ + fun sendTrajectoryReq(startGrayAndQueryContrailRsp: StartGrayAndQueryContrailRsp) { + startGrayAndQueryContrailRsp.contrail?.let { contrail -> + // 初始化自动驾驶需要的参数 + 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) + ) + } + } + + /** + * 更新灰度路线信息 + */ fun updateCurrentGrayLineAndContrail( grayLineBean: GrayLineBean?, contrailBean: ContrailBean?, @@ -442,6 +499,9 @@ object TaxiRoutingModel { currentGrayId = grayId } + /** + * 灰度测试路线,启动自动驾驶 + */ fun startAutoPilotByClick() { if (currentGrayLineBean == null || currentContrailBean == null) { CallerLogger.e( @@ -454,6 +514,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,13 +550,15 @@ object TaxiRoutingModel { return } + // 初始化自动驾驶需要的参数 val parameters = initAutopilotControlParameters(grayLineBean, contrailBean) if (null == parameters) { CallerLogger.e(TAG, "AutopilotControlParameters is empty.") return } - OchAutoPilotManager.startAutoPilot(parameters); + // 开启自动驾驶 + OchAutoPilotManager.startAutoPilot(parameters) DebugView.printInfoMsg("[启自驾] 调用成功") CallerLogger.d( @@ -503,6 +568,9 @@ object TaxiRoutingModel { mControllerStatusCallback?.startOpenAutopilot() } + /** + * 初始化自动驾驶控制参数 + */ private fun initAutopilotControlParameters( grayLineBean: GrayLineBean, contrailBean: ContrailBean @@ -520,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/unmanned/taxi/ui/routing/TaxiRoutingUiState.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingUiState.kt index c455353503..6797e281f2 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingUiState.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingUiState.kt @@ -6,6 +6,9 @@ import com.mogo.och.unmanned.taxi.bean.GrayLineBean data class TaxiRoutingUiState(val routingUiState: RoutingUIState) : IUiState +/** + * 算路UI状态 + */ sealed class RoutingUIState { object Init : RoutingUIState() 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 9849c55113..20d84040a4 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,6 +401,7 @@ class MoGoAutopilotControlProvider : } } } + private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() @@ -440,12 +446,15 @@ class MoGoAutopilotControlProvider : ) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) { - AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine()) + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, routeInfo: MessagePad.RouteInfo?) { + AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(),routeInfo) } - override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { - AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(), downloadType) + override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, routeInfo: MessagePad.RouteInfo?) { + AdasManager.getInstance().sendTrajectoryDownloadReq( + autoPilotLine.toAutoPilotLine(), + downloadType, + routeInfo) } override fun cancelAutoPilot() { 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..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 @@ -139,6 +142,7 @@ class AutopilotControlParameters { @JvmField var autoPilotLine: AutoPilotLine? = null // 自动驾驶路线 + class AutoPilotLine { var lineId = 0L var lineName = "" @@ -216,15 +220,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," + + "blackLatLons=$blackLatLons," + + "endLatLon=$endLatLon," + + "speedLimit=$speedLimit, " + + "vehicleType=$vehicleType, " + + "routeID=$routeID, " + + "routeName='$routeName', " + + "isSpeakVoice=$isSpeakVoice, " + + "autoPilotLine=$autoPilotLine)" } + + } \ 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 032f0c139c..0637b9c3ff 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,16 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { /** * 发送 轨迹下载请求 */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) + fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, routeInfo: MessagePad.RouteInfo?) /** * 发送 轨迹下载请求 - * @param downloadType 下载类型: 0:正常下载 1:预下载 + * + * @param autoPilotLine 线路相关参数详情见PB message_pad.proto -> Line + * @param downloadType 下载类型: 0:正常下载 1:预下载 + * @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! */ - fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) + 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 70b69195d4..3cd08a6536 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,24 @@ 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)) { - providerApi?.sendTrajectoryDownloadReq(autoPilotLine) + //TODO Routing 需要传参 routeInfo,这里建议业务侧重新整合到同一个数据实体内传入 + providerApi?.sendTrajectoryDownloadReq(autoPilotLine, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0) } } @@ -193,7 +207,8 @@ object CallerAutoPilotControlManager { */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType) + //TODO Routing 需要传参 routeInfo,这里建议业务侧重新整合到同一个数据实体内传入 + providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, null) CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType) } } 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 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 54a15f6401..c6db5a9b33 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,8 @@ message TrajectoryDownloadReq Line line = 1; //路线 uint32 source = 2; //指令来源: 0: default, 1:pad, 2:aicloud uint32 downloadType = 3; //下载类型: 0:正常下载 1:预下载 + + RouteInfo routeInfo = 4; //20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!(Line信息重复) } // message definition for MessageType: MsgTypeBasicInfoReq @@ -297,6 +299,8 @@ message Location double latitude = 2; double altitude = 3; double heading = 4; + + bool station = 5; //20240523, 判断此点是中间站点还是途径点 ------- true:站点, false:简单的途径点 } message RouteInfo @@ -311,7 +315,10 @@ message RouteInfo bool isSpeakVoice = 8; //abandoned uint32 routeID = 9; string routeName = 10; - Line line = 11; //路线信息 + Line line = 11; //路线信息,原有轨迹线路信息 + + repeated Location blackPoints = 12; //20240523 不让走的道路,异常线路点 + bool isStation = 13; //20240523 用于表示判断是否是站点下单。默认false:起点下单,接管下单; true: 中间站点下单 } message SetAutopilotModeReq @@ -319,6 +326,7 @@ 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; //自动驾驶路径信息 + } // 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..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 @@ -1189,9 +1189,9 @@ 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 自动驾驶路径信息 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 @@ -1655,8 +1655,9 @@ 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 routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填! * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 @@ -1669,13 +1670,18 @@ 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, 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); } + 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..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 @@ -393,9 +393,9 @@ 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 自动驾驶路径信息 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 @@ -758,30 +758,32 @@ 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 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, MessagePad.RouteInfo routeInfo) { + return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1, 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 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, 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 5ba39f8bf5..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 @@ -173,9 +173,9 @@ 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 自动驾驶路径信息 * @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID * * >=0:表示添加到WS发送消息队列 * * =0:表示乘客屏模式添加到WS发送消息队列 @@ -475,14 +475,15 @@ 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 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, MessagePad.RouteInfo routeInfo); /** * 发送 状态查询请求