diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java index 5f386b5de0..3967989855 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java @@ -466,10 +466,6 @@ public class BusPassengerModel { if (autopilotStatusInfo == null) return; int state = autopilotStatusInfo.getState(); if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { - //2022.7.20 自动驾驶更换成带档位的 - if(state != mPreAutoStatus && null != routesResult){ - CallerAutoPilotControlManager.INSTANCE.getGlobalPath(); - } if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning(); } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { if(state != mPreAutoStatus){ diff --git a/OCH/mogo-och-charter-passenger/src/main/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt b/OCH/mogo-och-charter-passenger/src/main/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt index 0e71a406f6..7a7f171110 100644 --- a/OCH/mogo-och-charter-passenger/src/main/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt +++ b/OCH/mogo-och-charter-passenger/src/main/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt @@ -238,19 +238,6 @@ object CharterPassengerModel { mAutoStatusChnageListener.forEach { it.value.onAutoStatusChange(state) } - when (state) { - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> { - RxUtils.createSubscribe { - cleanRoutePoints() - CallerLogger.d(M_BUS_P + TAG,"请求底盘轨迹") - CallerAutoPilotControlManager.getGlobalPath() - } - } - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {} - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {} - IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {} - else -> {} - } } } override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) { diff --git a/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt b/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt index f672347df6..8df2542c2d 100644 --- a/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt +++ b/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt @@ -305,9 +305,6 @@ class PM2DrivingModel private constructor() { }else{//自驾状态 2 mAutoStatusCallback?.updateAutoStatus(true) - if (routesResult != null){ - CallerAutoPilotControlManager.getGlobalPath() - } } mCurrentAutoStatus = status } @@ -502,10 +499,6 @@ class PM2DrivingModel private constructor() { } fun dynamicCalculateRouteInfo(){ - //如果轨迹点为空发送一次获取轨迹指令 - if (mRoutePoints.size == 0){ - CallerAutoPilotControlManager.getGlobalPath() - } //计算当前位置和下一站的剩余点集合 //计算剩余点总里程和时间 d(SceneConstant.M_BUS_P + TAG, "och-rotting==mTwoStationsRouts.size() = " + mTwoStationsRouts.size) diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java index fafbe54a2a..daaf6b231c 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java @@ -531,8 +531,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback // 当高频返回autopilot 2时,不重复调用订单状态变更 mPrevAPStatus = state; // 每个状态单独赋值,解决无订单时已经是2的状态导致的新订单来时无法进入此逻辑更新状态 startServicePilotDone(); - - CallerAutoPilotControlManager.INSTANCE.getGlobalPath(); } } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { mPrevAPStatus = state; diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt index ea44139ef5..5cf263bc7b 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -302,9 +302,6 @@ class MoGoAdasListenerImpl : OnAdasListener { autopilotStatusInfo.state = autopilotState.state autopilotStatusInfo.pilotmode = autopilotState.autopilotMode autopilotStatusInfo.reason = autopilotState.reason - autopilotStatusInfo.camera = autopilotState.camera - autopilotStatusInfo.rtk = autopilotState.rtk - autopilotStatusInfo.radar = autopilotState.radar autopilotStatusInfo.version = AdasManager.getInstance().adasVersion if (autopilotStatusInfo.connectIP == null) { autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt index f6dae9d389..e982acba0f 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt @@ -1,10 +1,24 @@ package com.mogo.eagle.core.function.datacenter.autopilot.server +import android.annotation.SuppressLint +import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult +import com.mogo.eagle.core.data.deva.chain.ChainConstant +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.zhidao.support.adas.high.AdasManager +import com.zhjt.service.chain.ChainLog +import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD +import io.reactivex.Observable +import io.reactivex.android.schedulers.AndroidSchedulers +import io.reactivex.disposables.Disposable +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicInteger /** * @author xiaoyuzhou @@ -14,7 +28,8 @@ import com.zhidao.support.adas.high.AdasManager * 异步同步数据给 Autopilot 控制器 * 数据源(不限于):OBU、网络等 */ -class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListener { +class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListener, + IMoGoAutopilotStatusListener { companion object { const val TAG = "AsyncDataToAutopilotServer" val INSTANCE: AsyncDataToAutopilotServer by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { @@ -22,10 +37,41 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen } } + private var mPreAutoStatus = AtomicInteger(-1) + private var createSubscribe: Disposable? = null + fun initServer() { + CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerTrafficLightListenerManager.addListener(TAG, this) } + @SuppressLint("CheckResult") + override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { + super.onAutopilotStatusResponse(autoPilotStatusInfo) + val state = autoPilotStatusInfo.state + if (mPreAutoStatus.get() != state) { + mPreAutoStatus.set(state) + createSubscribe?.let { + if (!it.isDisposed) { + bizLog(SceneConstant.M_ADAS_IMPL + TAG, "自动驾驶状态变化,取消前置轨迹请求,间隔2s重新请求底盘轨迹") + createSubscribe?.dispose() + } + } + + when (state) { + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> { + createSubscribe = Observable.timer(2000L, TimeUnit.MILLISECONDS) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { + bizLog(SceneConstant.M_ADAS_IMPL + TAG, "请求底盘轨迹") + CallerAutoPilotControlManager.getGlobalPath() + } + } + else -> {} + } + } + } + override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) { var version = -1 if (AdasManager.getInstance().carConfig != null) { @@ -34,4 +80,16 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen if (version > -1 && version < 290) CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult) } + + @ChainLog( + linkChainLog = ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT, + linkCode = ChainConstant.CHAIN_LINK_ADAS, + endpoint = PAD, + nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_BIZ, + paramIndexes = [0, 1], + clientPkFileName = "sn" + ) + private fun bizLog(tag: String, msg: String) { + CallerLogger.d(tag, msg) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt index f01a19ef74..821a558cf1 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt @@ -11,7 +11,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel.Companion.aiCloudIdentifyNetWorkModel import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager @@ -51,7 +50,6 @@ class AiCloudIdentifyDataManager : IMogoMapListener, MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this) CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerPlanningRottingListenerManager.addListener(TAG,this) - CallerAutoPilotControlManager.getGlobalPath() MogoAiCloudSocketManager.getInstance(mContext) .registerOnMessageListener( 0x040003, //低频数据 @@ -166,8 +164,6 @@ class AiCloudIdentifyDataManager : IMogoMapListener, super.onAutopilotRouteLineId(lineId) if (lineId == 0L) { updateRomaStyle(true) - }else{ - CallerAutoPilotControlManager.getGlobalPath() } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt index 0007077814..b96081473a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt @@ -17,7 +17,6 @@ import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager @@ -296,10 +295,10 @@ class SmallMapView @JvmOverloads constructor( endLatLng.latitude, endLatLng.longitude, currentLatLng.latitude, currentLatLng.longitude ) - CallerLogger.d( - SceneConstant.M_MAP + TAG, - "calculateDistance=$calculateDistance" - ) +// CallerLogger.d( +// SceneConstant.M_MAP + TAG, +// "calculateDistance=$calculateDistance" +// ) if (calculateDistance <= 5) { CallerLogger.d( SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ") @@ -325,8 +324,6 @@ class SmallMapView @JvmOverloads constructor( UiThreadHandler.post { clearPolyline() } - } else if (tempStatus == 1 && autoPilotStatus == 0) { - getGlobalPath() } autoPilotStatus = tempStatus } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index 71c68c6d79..13b502df3d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -28,7 +28,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.api.autopilot.IMoGoV2XListener import com.mogo.eagle.core.function.api.biz.IFuncBizProvider -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager @@ -414,8 +413,6 @@ class OverMapView @JvmOverloads constructor( } }) CallerV2XListenerManager.addListener(TAG, this) - // 主动查一次全局路径规划的数据 - getGlobalPath() } private fun setUpMap() { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt index 3f9c1900e3..2dd8130231 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt @@ -56,21 +56,6 @@ open class AutopilotStatusInfo : Serializable, Cloneable { */ var reason: String? = null - /** - * 摄像头状态 1代表开启,0代表关闭 - */ - var camera = 0 - - /** - * 雷达状态 1代表开启,0代表关闭 - */ - var radar = 0 - - /** - * RTK状态 1代表开启,0代表关闭 - */ - var rtk = 0 - /** * 底盘的自动驾驶状态 0非自动驾驶,1自动驾驶 */ @@ -89,8 +74,8 @@ open class AutopilotStatusInfo : Serializable, Cloneable { return "connectIP=$connectIP, connectPort=$connectPort, " + "connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," + " locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," + - " satelliteTime=$satelliteTime, state=$state, reason=$reason, camera=$camera," + - " radar=$radar, rtk=$rtk, pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters" + " satelliteTime=$satelliteTime, state=$state, reason=$reason, " + + " pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters" } public override fun clone(): AutopilotStatusInfo { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt index ef0752e799..dff8f76de8 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt @@ -60,7 +60,7 @@ class ChainConstant { const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS" const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_ACTIONS = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_ACTIONS" const val CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP = "CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP" - const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN = "PAD_ADAS_MESSAGE_AUTOPILOT_WARN" + const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_BIZ = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_BIZ" const val CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK = "CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK" const val CHAIN_ALIAS_CODE_RECORD_ANR = "CHAIN_ALIAS_CODE_RECORD_ANR" diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt index 87d4452fb7..d13d406c6e 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt @@ -13,7 +13,7 @@ import system_master.* interface IMoGoAutopilotStatusListener { /** - * 自动驾驶状态信息 + * 自动驾驶状态信息 TODO 接口优化,拆分业务属性字段 * * @param autoPilotStatusInfo 状态信息 */