diff --git a/core/function-impl/mogo-core-function-autopilot/build.gradle b/core/function-impl/mogo-core-function-autopilot/build.gradle
index 0cf2df7226..49e96989a9 100644
--- a/core/function-impl/mogo-core-function-autopilot/build.gradle
+++ b/core/function-impl/mogo-core-function-autopilot/build.gradle
@@ -52,15 +52,22 @@ dependencies {
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.adasHigh
+ implementation rootProject.ext.dependencies.mogoami
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
+ implementation rootProject.ext.dependencies.modulecommon
+
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_utils
+ implementation rootProject.ext.dependencies.mogo_core_network
implementation rootProject.ext.dependencies.mogo_core_function_api
implementation rootProject.ext.dependencies.mogo_core_function_call
} else {
+ implementation project(':modules:mogo-module-common')
+
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
+ implementation project(':core:mogo-core-network')
implementation project(':core:mogo-core-function-api')
implementation project(':core:mogo-core-function-call')
}
diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt
index 68ac9a4333..b1b7b8ea67 100644
--- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt
@@ -6,13 +6,16 @@ import androidx.annotation.RequiresPermission
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
+import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
+import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl
+import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer
+import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.GsonUtils
-import com.mogo.eagle.core.utilcode.util.LogUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.bean.IPCUpgradeInfo
@@ -34,9 +37,26 @@ class MoGoAutopilotProvider :
get() = TAG
override fun init(context: Context) {
+ Logger.d(TAG, "初始化工控机连接……")
mContext = context
// 初始化ADAS 域控制器
- //AdasManager.getInstance().create(context)
+ CupidLogUtils.setEnableLog(false)
+ CupidLogUtils.setIsWriteLog(false)
+ // TODO 临时方案,根据不同的身份标识,连接不同的工控机IP
+ when (FunctionBuildConfig.appIdentityMode) {
+ 0 -> // 司机
+ AdasManager.getInstance().create(context, "192.168.1.102")
+ 1 -> // 乘客
+ AdasManager.getInstance().create(context, "192.168.1.103")
+ else -> // 默认采用UDP寻址方式
+ AdasManager.getInstance().create(context)
+ }
+ //////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
+ // 监听 adas 连接状态
+ AdasManager.getInstance().setOnAdasConnectStatusListener(MoGoAdasMsgConnectStatusListenerImpl())
+ // 监听ADAS-SDK获取到的工控机数据
+ AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
+ // 同步数据给工控机的服务
AsyncDataToAutopilotServer.INSTANCE.initServer()
}
@@ -72,7 +92,7 @@ class MoGoAutopilotProvider :
val parameter = AutopilotControlCmdParameter("aiCloudToStartAutopilot", result)
AdasManager.getInstance().aiCloudToAdasData(GsonUtils.toJson(parameter))
} else {
- LogUtils.eTag(TAG, "车机与工控机链接失败,无法开启自动驾驶")
+ Logger.e(TAG, "车机与工控机链接失败,无法开启自动驾驶")
}
}
@@ -84,7 +104,7 @@ class MoGoAutopilotProvider :
if (AdasManager.getInstance().isSocketConnect) {
AdasManager.getInstance().controlAutopilotCarHead()
} else {
- LogUtils.eTag(TAG, "车机与工控机链接失败,无法断开自动驾驶")
+ Logger.e(TAG, "车机与工控机链接失败,无法断开自动驾驶")
}
}
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.java
similarity index 94%
rename from modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java
rename to core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.java
index 799d3d7b05..8ae436afc8 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.java
@@ -1,4 +1,4 @@
-package com.mogo.module.adas;
+package com.mogo.eagle.core.function.autopilot.adapter;
import android.util.Log;
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
import com.mogo.eagle.core.data.traffic.TrafficData;
+import com.mogo.eagle.core.function.autopilot.utils.AdasObjectConvertUtils;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
@@ -45,19 +46,18 @@ import java.util.List;
*
* 适配ADAS 回调监听分发
*/
-public class OnAdasListenerAdapter implements OnAdasListener {
+public class MoGoAdasListenerImpl implements OnAdasListener {
private final String TAG = "OnAdasListenerAdapter";
@Override
public void onRectData(RectInfo rectInfo) {
if (HdMapBuildConfig.isMapLoaded) {
- ArrayList recognizedListResults = AdasObjectUtils.INSTANCE.regroupTrafficDataData(rectInfo.getModels());
+ ArrayList recognizedListResults = AdasObjectConvertUtils.INSTANCE.regroupTrafficDataData(rectInfo.getModels());
CallerAutopilotIdentifyListenerManager.INSTANCE.invokeAutopilotIdentifyDataUpdate(recognizedListResults);
}
}
-
@Override
public void onCarStateData(CarStateInfo carStateInfo) {
if (HdMapBuildConfig.isMapLoaded) {
@@ -65,23 +65,19 @@ public class OnAdasListenerAdapter implements OnAdasListener {
//can数据转发
CarStateInfo.ValuesBean bean = carStateInfo.getValues();
// Log.w("DHY-location", bean.getLon() + "," + bean.getLat() + " OnAdasListenerAdapter-onCarStateData:");
-
if (bean != null) {
int turnLight = bean.getTurnLightOften(); //转向灯状态 0是正常 1是左转 2是右转
AmiClientManager.getInstance().setTurnLightState(turnLight);
int brakeLight = bean.getBrake_light(); //TODO
// Logger.d(TAG, "onCarStateData ---- turnLight = " + turnLight + "---brakeLight = " + brakeLight);
-
//设置转向灯
CallerHmiManager.INSTANCE.showTurnLight(turnLight);
-
//设置刹车信息
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
} else {
Logger.e(TAG, "bean == null ");
}
-
- AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
+ AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectConvertUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo);
}
}
@@ -134,7 +130,7 @@ public class OnAdasListenerAdapter implements OnAdasListener {
public void onAutopilotRoute(AutopilotRoute route) {
if (HdMapBuildConfig.isMapLoaded) {
Logger.d(TAG, "onAutopilotRoute : " + route.toString());
- AutopilotRouteInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAdasAutopilotRoute(route);
+ AutopilotRouteInfo autopilotRoute = AdasObjectConvertUtils.INSTANCE.fromAdasAutopilotRoute(route);
CallerAutopilotPlanningListenerManager.INSTANCE.invokeAutopilotRotting(autopilotRoute);
}
}
@@ -172,7 +168,7 @@ public class OnAdasListenerAdapter implements OnAdasListener {
@Override
public void onAutopilotGuardian(AutopilotGuardianInfo guardianInfo) {
if (HdMapBuildConfig.isMapLoaded) {
- AutopilotGuardianStatusInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAutopilotGuardianInfo(guardianInfo);
+ AutopilotGuardianStatusInfo autopilotRoute = AdasObjectConvertUtils.INSTANCE.fromAutopilotGuardianInfo(guardianInfo);
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotGuardian(autopilotRoute);
}
}
@@ -214,7 +210,7 @@ public class OnAdasListenerAdapter implements OnAdasListener {
@Override
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
- final AutopilotWarnMessage warnMessage = AdasObjectUtils.INSTANCE.fromAdasObject(warnMessageInfo);
+ final AutopilotWarnMessage warnMessage = AdasObjectConvertUtils.INSTANCE.fromAdasObject(warnMessageInfo);
CallerAutopilotIdentifyListenerManager.INSTANCE.invokeAutopilotWarnMessage(warnMessage);
}
diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt
new file mode 100644
index 0000000000..233a997ead
--- /dev/null
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt
@@ -0,0 +1,100 @@
+package com.mogo.eagle.core.function.autopilot.adapter
+
+import com.mogo.cloud.passport.MoGoAiCloudClientConfig
+import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo
+import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
+import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
+import com.mogo.eagle.core.function.autopilot.network.AdasServiceModel
+import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
+import com.mogo.eagle.core.utilcode.mogo.logger.Logger
+import com.zhidao.support.adas.high.AdasManager
+import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener
+import com.zhidao.support.adas.high.bean.BasicInfo
+import io.reactivex.Flowable
+import io.reactivex.android.schedulers.AndroidSchedulers
+import io.reactivex.schedulers.Schedulers
+import java.util.concurrent.TimeUnit
+
+/**
+ * ADAS-SDK与工控机连接状态回调
+ *
+ * @author donghongyu
+ */
+class MoGoAdasMsgConnectStatusListenerImpl : OnAdasMsgConnectStatusListener, IMoGoAutopilotStatusListener {
+ private val TAG = "MoGoAdasMsgConnectStatusListenerImpl"
+
+ //自动驾驶状态
+ private var mCurrentAutopilotStatus = -1
+
+ //自动驾驶车速度
+ private var mCurrentAutopilotSpeed = 0f
+
+ override fun onWebSocketConnectSuccess() {
+ Logger.d(TAG, "webSocket 连接成功")
+ // 初始化自动驾驶状态信息
+ CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectIP = AdasManager.getInstance().adasConfig.address
+ CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = true
+ CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
+
+ // 同步SN给工控机
+ syncBasicInfoToAutopilot()
+
+ // 开启轮训上传自动驾驶状态
+ updateDriveStatusTask()
+ }
+
+ override fun onWebSocketConnectFailed(reason: String) {
+ Logger.d(TAG, "webSocket 连接失败 reason:$reason")
+ CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectIP = AdasManager.getInstance().adasConfig.address
+ CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = false
+ CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
+ }
+
+ /**
+ * 工控机获取SN
+ */
+ override fun onAutopilotSNRequest() {
+ syncBasicInfoToAutopilot()
+ }
+
+ override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) {
+ if (autopilotWayArrive != null) {
+ val lon = autopilotWayArrive.lon
+ val lat = autopilotWayArrive.lat
+ AdasServiceModel.getInstance().reportSite(lon, lat)
+ }
+ }
+
+ override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
+ val state = autoPilotStatusInfo.state
+ val speed = autoPilotStatusInfo.speed
+ mCurrentAutopilotStatus = state
+ mCurrentAutopilotSpeed = speed
+ }
+
+ /**
+ * 同步SN信息给工控机
+ */
+ fun syncBasicInfoToAutopilot() {
+ Logger.d(TAG, "同步PAD的SN给工控机……")
+ val info = BasicInfo()
+ info.setSn(MoGoAiCloudClientConfig.getInstance().sn)
+ AdasManager.getInstance().setBasicInfo(info)
+ }
+
+ /**
+ * 上传自动驾驶状态任务
+ */
+ fun updateDriveStatusTask() {
+ Logger.d(TAG, "updateDriveStatusTask")
+ Flowable.interval(0, 5, TimeUnit.SECONDS)
+ .subscribeOn(Schedulers.io())
+ .unsubscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe { aLong: Long? ->
+ AdasServiceModel.getInstance().updateDriveStatus(mCurrentAutopilotStatus, mCurrentAutopilotSpeed)
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAutopilotStatusListenerImpl.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAutopilotStatusListenerImpl.java
deleted file mode 100644
index b4ef89d40c..0000000000
--- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAutopilotStatusListenerImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.mogo.eagle.core.function.autopilot.adapter;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
-import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
-import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
-import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
-
-/**
- * @author xiaoyuzhou
- * @date 2021/10/20 1:02 下午
- * 自动驾驶状态回调用
- */
-public class MoGoAutopilotStatusListenerImpl implements IMoGoAutopilotStatusListener {
- @Override
- public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
-
- }
-
- @Override
- public void onAutopilotArriveAtStation(@Nullable AutopilotStationInfo autopilotWayArrive) {
-
- }
-
-
- @Override
- public void onAutopilotSNRequest() {
-
- }
-
- @Override
- public void onAutopilotGuardian(@Nullable AutopilotGuardianStatusInfo guardianInfo) {
-
- }
-
-}
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/AutonomousDriveStatusBean.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/AutonomousDriveStatusBean.java
similarity index 93%
rename from modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/AutonomousDriveStatusBean.java
rename to core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/AutonomousDriveStatusBean.java
index e4bba0a1e2..2557f03e5e 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/AutonomousDriveStatusBean.java
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/AutonomousDriveStatusBean.java
@@ -1,4 +1,4 @@
-package com.mogo.module.adas.entity;
+package com.mogo.eagle.core.function.autopilot.entity;
/**
* Created by XuYong on 2021/5/28 16:12
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportSiteBean.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/ReportSiteBean.java
similarity index 92%
rename from modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportSiteBean.java
rename to core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/ReportSiteBean.java
index ed0f765e2e..9b1f9f4328 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportSiteBean.java
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/ReportSiteBean.java
@@ -1,4 +1,4 @@
-package com.mogo.module.adas.entity;
+package com.mogo.eagle.core.function.autopilot.entity;
/**
* Created by XuYong on 2021/5/31 16:24
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/AdasServiceModel.java
similarity index 84%
rename from modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java
rename to core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/AdasServiceModel.java
index 31553c43b3..009c446151 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/AdasServiceModel.java
@@ -1,24 +1,27 @@
-package com.mogo.module.adas.model;
+package com.mogo.eagle.core.function.autopilot.network;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
+import com.mogo.commons.context.ContextHolderUtil;
import com.mogo.eagle.core.data.BaseData;
+import com.mogo.eagle.core.function.autopilot.entity.AutonomousDriveStatusBean;
+import com.mogo.eagle.core.function.autopilot.entity.ReportSiteBean;
import com.mogo.eagle.core.network.RequestOptions;
import com.mogo.eagle.core.network.SubscribeImpl;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
-import com.mogo.module.adas.entity.AutonomousDriveStatusBean;
-import com.mogo.module.adas.entity.ReportSiteBean;
-import com.mogo.module.adas.network.IAdasApiService;
import com.mogo.module.common.MogoApisHandler;
+import com.mogo.module.common.constants.HostConst;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
import okhttp3.RequestBody;
-import static com.mogo.commons.context.ContextHolderUtil.getContext;
-import static com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST;
-
+/**
+ * 将自动驾驶状态及站点信息上传给云平台,云平台会根据此数据做路线的绘制
+ *
+ * @author dongghongyu
+ */
public class AdasServiceModel {
private static final String TAG = "AdasServiceModel";
@@ -28,7 +31,7 @@ public class AdasServiceModel {
private final IAdasApiService mAdasApiService;
private AdasServiceModel() {
- this.mAdasApiService = MogoApisHandler.getInstance().getApis().getNetworkApi().create(IAdasApiService.class, DATA_SERVICE_HOST);
+ this.mAdasApiService = MogoApisHandler.getInstance().getApis().getNetworkApi().create(IAdasApiService.class, HostConst.DATA_SERVICE_HOST);
}
public static AdasServiceModel getInstance() {
@@ -48,7 +51,7 @@ public class AdasServiceModel {
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mAdasApiService.updateAutonomousDriveStatus(requestBody).
subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
- .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) {
+ .subscribe(new SubscribeImpl(RequestOptions.create(ContextHolderUtil.getContext())) {
@Override
public void onError(String message, int code) {
super.onError(message, code);
@@ -73,7 +76,7 @@ public class AdasServiceModel {
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(reportSiteBean));
mAdasApiService.updateReportSite(requestBody).
subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
- .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) {
+ .subscribe(new SubscribeImpl(RequestOptions.create(ContextHolderUtil.getContext())) {
@Override
public void onError(String message, int code) {
super.onError(message, code);
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/IAdasApiService.java
similarity index 93%
rename from modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java
rename to core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/IAdasApiService.java
index e3fe324cfb..b9565cf782 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/IAdasApiService.java
@@ -1,4 +1,4 @@
-package com.mogo.module.adas.network;
+package com.mogo.eagle.core.function.autopilot.network;
import com.mogo.eagle.core.data.BaseData;
diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/utils/AdasObjectConvertUtils.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/utils/AdasObjectConvertUtils.kt
index d698761766..e729b26521 100644
--- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/utils/AdasObjectConvertUtils.kt
+++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/utils/AdasObjectConvertUtils.kt
@@ -1,10 +1,102 @@
package com.mogo.eagle.core.function.autopilot.utils
+import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo
+import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo
+import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo
+import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage
+import com.mogo.eagle.core.data.enums.TrafficTypeEnum
+import com.mogo.eagle.core.data.traffic.TrafficData
+import com.zhidao.support.adas.high.bean.AutopilotRoute
+import com.zhidao.support.adas.high.bean.CarStateInfo
+import com.zhidao.support.adas.high.bean.RectInfo
+import com.zhidao.support.adas.high.bean.WarnMessageInfo
+import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo
+import com.zhidao.utils.common.GsonUtil
+
/**
* @author xiaoyuzhou
* @date 2021/10/18 1:32 下午
*/
-class AdasObjectConvertUtils {
+object AdasObjectConvertUtils {
+ val TAG = "AdasObjectConvertUtils"
+
+ fun fromAutopilotGuardianInfo(autopilotGuardianInfo: AutopilotGuardianInfo): AutopilotGuardianStatusInfo? {
+ return GsonUtil.objectFromJson(
+ GsonUtil.jsonFromObject(autopilotGuardianInfo),
+ AutopilotGuardianStatusInfo::class.java
+ )
+ }
+
+ fun fromAdasAutopilotRoute(carStateInfo: AutopilotRoute): AutopilotRouteInfo? {
+ return GsonUtil.objectFromJson(
+ GsonUtil.jsonFromObject(carStateInfo),
+ AutopilotRouteInfo::class.java
+ )
+ }
+
+ fun fromAdasCarStateInfoObject(carStateInfo: CarStateInfo): AutopilotCarStateInfo? {
+ return GsonUtil.objectFromJson(
+ GsonUtil.jsonFromObject(carStateInfo),
+ AutopilotCarStateInfo::class.java
+ )
+ }
+
+ fun fromAdasObject(info: WarnMessageInfo?): AutopilotWarnMessage? {
+ if (info == null) {
+ return null
+ }
+ val warnMessage = AutopilotWarnMessage()
+ warnMessage.content = info.content
+ warnMessage.level = info.level
+ try {
+ warnMessage.type = info.type.toInt()
+ } catch (e: NumberFormatException) {
+ return null
+ }
+ warnMessage.value = info.value
+ return warnMessage
+ }
+
+ fun regroupTrafficDataData(datums: List?): ArrayList? {
+ if (datums == null || datums.isEmpty()) {
+ return null
+ }
+ val recognizedListResults: ArrayList = ArrayList()
+ for (model in datums) {
+ if (model == null) {
+ continue
+ }
+ val recognizedListResult = fromAdasTrafficDataObject(model)
+ if (recognizedListResult != null) {
+ recognizedListResults.add(recognizedListResult)
+ }
+ }
+ return recognizedListResults
+ }
+
+ fun fromAdasTrafficDataObject(model: RectInfo.RectBean?): TrafficData? {
+ if (model == null) {
+ return null
+ }
+ val result = TrafficData()
+ result.uuid = model.uuid
+ result.lat = model.lat
+ result.lon = model.lon
+ result.type = TrafficTypeEnum.getType(model.type.toInt())
+ result.heading = model.heading
+ result.systemTime = model.systemTime.toLong()
+ result.satelliteTime = model.satelliteTime.toLong()
+ result.alt = model.alt
+ result.speed = model.speed
+ result.carId = model.carId
+ result.dataAccuracy = model.dataAccuracy
+ result.distance = model.distance
+ result.threatLevel = model.drawlevel
+
+ //Log.d(TAG, "TrafficData = $result")
+ return result
+ }
+
}
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 8b09cbb008..aaf8923fd6 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
@@ -16,16 +16,14 @@ interface IMoGoAutopilotStatusListener {
*
* @param autoPilotStatusInfo 状态信息
*/
- fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo)
+ fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo){}
/**
* 自动驾驶到站
*
* @param autopilotWayArrive 所到车站的简单信息
*/
- fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?){
-
- }
+ fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?){}
/**
* 工控机获取SN
@@ -35,9 +33,7 @@ interface IMoGoAutopilotStatusListener {
/**
* 工控机监控节点
*/
- fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?){
-
- }
+ fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?){}
companion object {
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java
index f93a41f096..2401fc18a1 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java
+++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java
@@ -1,52 +1,28 @@
package com.mogo.module.adas;
-import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.google.gson.Gson;
-import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
-import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
-import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
-import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
-import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
-import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
-import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
-import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
-import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
-import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
-import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
+import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
-import com.mogo.module.adas.model.AdasServiceModel;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
-import com.zhidao.support.adas.high.AdasManager;
-import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener;
-import com.zhidao.support.adas.high.bean.BasicInfo;
import com.zhidao.support.obu.ami.AmiClientManager;
import java.util.ArrayList;
-import java.util.concurrent.TimeUnit;
-
-import io.reactivex.Flowable;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.schedulers.Schedulers;
/**
* Created by XuYong on 2021/4/25 14:43
*/
public class AdasEventManager implements
- OnAdasMsgConnectStatusListener,
- IMoGoAutopilotStatusListener,
- IMoGoAutopilotPlanningListener,
IMoGoAutopilotIdentifyListener,
IMoGoAutopilotCarStateListener {
@@ -55,18 +31,9 @@ public class AdasEventManager implements
private static volatile AdasEventManager adasEventManager;
private static final byte[] obj = new byte[0];
- private final Gson gson;
private final ArrayList iAdasEventListeners = new ArrayList<>();
- //自动驾驶状态
- private int mCurrentAutopilotStatus = -1;
- //自动驾驶车速度
- private float mCurrentAutopilotSpeed = 0;
-
private AdasEventManager() {
- gson = GsonUtil.getGson();
- CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
- CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotIdentifyListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotCarStatusListenerManager.INSTANCE.addListener(TAG, this);
}
@@ -95,89 +62,11 @@ public class AdasEventManager implements
iAdasEventListeners.remove(listener);
}
- /**
- * 同步SN信息给工控机
- */
- public void syncBasicInfoToAutopilot() {
- Logger.d(TAG, "同步PAD的SN给工控机……");
- BasicInfo info = new BasicInfo();
- info.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
- AdasManager.getInstance().setBasicInfo(info);
- }
-
- @Override
- public void onAutopilotSNRequest() {
- syncBasicInfoToAutopilot();
- }
-
- @Override
- public void onWebSocketConnectSuccess() {
- Logger.d(TAG, "webSocket 连接成功");
- // 初始化自动驾驶状态信息
- CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
- CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectStatus(true);
-
- CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
-
- // 同步SN给工控机
- syncBasicInfoToAutopilot();
-
- // 开启轮训上传自动驾驶状态
- updateDriveStatusTask();
- }
-
- @Override
- public void onWebSocketConnectFailed(String reason) {
- Logger.d(TAG, "webSocket 连接失败 reason:" + reason);
- CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
- CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectStatus(false);
- CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
- }
-
- public void updateDriveStatusTask() {
- Logger.d(TAG, "updateDriveStatusTask");
- Flowable.interval(0, 5, TimeUnit.SECONDS)
- .subscribeOn(Schedulers.io())
- .unsubscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(aLong -> updateDriveStatus());
- }
-
- private void updateDriveStatus() {
- AdasServiceModel.getInstance().updateDriveStatus(mCurrentAutopilotStatus, mCurrentAutopilotSpeed);
- }
-
- private void reportSite(double lon, double lat) {
- AdasServiceModel.getInstance().reportSite(lon, lat);
- }
-
- @Override
- public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
- int state = autoPilotStatusInfo.getState();
- float speed = autoPilotStatusInfo.getSpeed();
- mCurrentAutopilotStatus = state;
- mCurrentAutopilotSpeed = speed;
- for (IAdasDataListener listener : iAdasEventListeners) {
- if (listener != null) {
- listener.notifyAutopilotState(autoPilotStatusInfo);
- }
- }
- }
-
- @Override
- public void onAutopilotArriveAtStation(AutopilotStationInfo autopilotWayArrive) {
- if (autopilotWayArrive != null) {
- double lon = autopilotWayArrive.getLon();
- double lat = autopilotWayArrive.getLat();
- reportSite(lon, lat);
- }
- }
-
@Override
public void onAutopilotCarStateData(@Nullable AutopilotCarStateInfo autoPilotCarStateInfo) {
for (IAdasDataListener listener : iAdasEventListeners) {
if (listener != null) {
- listener.ownerCarStateInfo(gson.toJson(autoPilotCarStateInfo));
+ listener.ownerCarStateInfo(GsonUtils.toJson(autoPilotCarStateInfo));
}
}
@@ -194,11 +83,6 @@ public class AdasEventManager implements
}
- @Override
- public void onAutopilotGuardian(@Nullable AutopilotGuardianStatusInfo guardianInfo) {
-
- }
-
@Override
public void onAutopilotIdentifyDataUpdate(@Nullable ArrayList trafficData) {
try {
@@ -217,16 +101,6 @@ public class AdasEventManager implements
}
- @Override
- public void onAutopilotTrajectory(ArrayList trajectoryInfo) {
-
- }
-
-
- @Override
- public void onAutopilotRotting(@Nullable AutopilotRouteInfo autopilotRoute) {
-
- }
@Override
public void onAutopilotRecordResult(AutoPilotRecordResult result) {
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt
deleted file mode 100644
index 78968f5c9f..0000000000
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.mogo.module.adas
-
-import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo
-import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo
-import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo
-import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage
-import com.mogo.eagle.core.data.enums.TrafficTypeEnum
-import com.mogo.eagle.core.data.traffic.TrafficData
-import com.mogo.eagle.core.network.utils.GsonUtil
-import com.zhidao.support.adas.high.bean.AutopilotRoute
-import com.zhidao.support.adas.high.bean.CarStateInfo
-import com.zhidao.support.adas.high.bean.RectInfo.RectBean
-import com.zhidao.support.adas.high.bean.WarnMessageInfo
-import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo
-
-/**
- * @author congtaowang
- * @since 2020/10/25
- *
- * 对象转换类
- */
-object AdasObjectUtils {
- val TAG = "AdasObjectUtils"
-
- fun fromAutopilotGuardianInfo(autopilotGuardianInfo: AutopilotGuardianInfo): AutopilotGuardianStatusInfo? {
- return GsonUtil.objectFromJson(
- GsonUtil.jsonFromObject(autopilotGuardianInfo),
- AutopilotGuardianStatusInfo::class.java
- )
- }
-
- fun fromAdasAutopilotRoute(carStateInfo: AutopilotRoute): AutopilotRouteInfo? {
- return GsonUtil.objectFromJson(
- GsonUtil.jsonFromObject(carStateInfo),
- AutopilotRouteInfo::class.java
- )
- }
-
- fun fromAdasCarStateInfoObject(carStateInfo: CarStateInfo): AutopilotCarStateInfo? {
- return GsonUtil.objectFromJson(
- GsonUtil.jsonFromObject(carStateInfo),
- AutopilotCarStateInfo::class.java
- )
- }
-
- fun fromAdasObject(info: WarnMessageInfo?): AutopilotWarnMessage? {
- if (info == null) {
- return null
- }
- val warnMessage = AutopilotWarnMessage()
- warnMessage.content = info.content
- warnMessage.level = info.level
- try {
- warnMessage.type = info.type.toInt()
- } catch (e: NumberFormatException) {
- return null
- }
- warnMessage.value = info.value
- return warnMessage
- }
-
- fun regroupTrafficDataData(datums: List?): ArrayList? {
- if (datums == null || datums.isEmpty()) {
- return null
- }
- val recognizedListResults: ArrayList = ArrayList()
- for (model in datums) {
- if (model == null) {
- continue
- }
- val recognizedListResult = fromAdasTrafficDataObject(model)
- if (recognizedListResult != null) {
- recognizedListResults.add(recognizedListResult)
- }
- }
- return recognizedListResults
- }
-
- fun fromAdasTrafficDataObject(model: RectBean?): TrafficData? {
- if (model == null) {
- return null
- }
- val result = TrafficData()
- result.uuid = model.uuid
- result.lat = model.lat
- result.lon = model.lon
- result.type = TrafficTypeEnum.getType(model.type.toInt())
- result.heading = model.heading
- result.systemTime = model.systemTime.toLong()
- result.satelliteTime = model.satelliteTime.toLong()
- result.alt = model.alt
- result.speed = model.speed
- result.carId = model.carId
- result.dataAccuracy = model.dataAccuracy
- result.distance = model.distance
- result.threatLevel = model.drawlevel
-
- //Log.d(TAG, "TrafficData = $result")
- return result
- }
-
-
-}
\ No newline at end of file
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasProvider.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasProvider.java
index 7130cdeb32..4065c8aa50 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasProvider.java
+++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasProvider.java
@@ -4,11 +4,8 @@ import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
-import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
-import com.zhidao.support.adas.high.AdasManager;
-import com.zhidao.support.adas.high.common.CupidLogUtils;
/**
@@ -27,29 +24,6 @@ public class AdasProvider implements IProvider {
public void init(Context context) {
Logger.d(TAG, "初始化 AdasProvider 模块");
adasEventManager = AdasEventManager.getInstance();
- initAdas(context, adasEventManager);
- }
-
- private void initAdas(Context context, AdasEventManager adasEventManager) {
- CupidLogUtils.setEnableLog(false);
- CupidLogUtils.setIsWriteLog(false);
- // TODO 临时方案,根据不同的身份标识,连接不同的工控机IP
- switch (FunctionBuildConfig.appIdentityMode) {
- case 0:
- // 司机
- AdasManager.getInstance().create(context, "192.168.1.102");
- break;
- case 1:
- // 乘客
- AdasManager.getInstance().create(context, "192.168.1.103");
- break;
- default:
- // 默认采用UDP寻址方式
- AdasManager.getInstance().create(context);
- break;
- }
- AdasManager.getInstance().setOnAdasListener(new OnAdasListenerAdapter());
- AdasManager.getInstance().setOnAdasConnectStatusListener(adasEventManager);
}
public void addAdasEventListener(IAdasDataListener listener) {
@@ -60,8 +34,4 @@ public class AdasProvider implements IProvider {
adasEventManager.removeEventListener(listener);
}
- public void sendWsMessage(String msg) {
- AdasManager.getInstance().aiCloudToAdasData(msg);
- }
-
}
diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java
index 880297c08f..6d9c6319d3 100644
--- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java
+++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java
@@ -1,7 +1,5 @@
package com.mogo.module.adas;
-import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
-
public interface IAdasDataListener {
@@ -13,12 +11,4 @@ public interface IAdasDataListener {
default void ownerCarStateInfo(String ownerCarStateInfo) {
}
- /**
- * 自动驾驶状态信息
- *
- * @param autopilotStatus {@link AutopilotStatusInfo}
- */
- default void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
- }
-
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
index fbb84ab24e..1e7e5d031f 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
@@ -86,7 +86,6 @@ public class MogoServices implements IMogoMapListener,
private boolean mInternalUnWakeupRegisterStatus = false;
- private Location mLastCarLocation;
private MogoServices() {
// private constructor
@@ -201,7 +200,6 @@ public class MogoServices implements IMogoMapListener,
}
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, false );
mUiController.changeZoom( ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
-// mUiController.setLockZoom( ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
mStatusManager.setUserInteractionStatus( TAG, true, false );
mUiController.recoverLockMode();
notifyRefreshData( mLastAutoRefreshLocation, ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS, mAutoRefreshCallback );
@@ -265,11 +263,6 @@ public class MogoServices implements IMogoMapListener,
private Handler mThreadHandler;
- /**
- * 当前限速
- */
- private int mCurrentLimit = -1;
-
private final IMogoStatusChangedListener statusChangedListener = new StatusChangedAdapter() {
@Override
@@ -646,7 +639,6 @@ public class MogoServices implements IMogoMapListener,
if ( latLng == null ) {
return;
}
- mLastCarLocation = latLng;
// poi 定位无法获取时,使用该定位
if ( mLastAutoRefreshLocation == null ) {
MogoLatLng point = new MogoLatLng( latLng.getLatitude(), latLng.getLongitude() );
@@ -834,10 +826,6 @@ public class MogoServices implements IMogoMapListener,
MoGoAiCloudRealTime.stopRealTime();
}
- public Location getLastCarLocation() {
- return mLastCarLocation;
- }
-
private boolean mLastStatusIsVr = false;
public boolean isLastStatusIsVr() {
@@ -876,7 +864,8 @@ public class MogoServices implements IMogoMapListener,
@Override
public void onAdasCarDataCallback( AutopilotCarStateInfo stateInfo ) {
- if(TimeDelayUploadManager.getInstance().isMock()){ //模拟数据时,不更新由工控机传输的自车位置
+ //模拟数据时,不更新由工控机传输的自车位置
+ if(TimeDelayUploadManager.getInstance().isMock()){
return;
}
diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/adas/IMogoAdasOCHCallback.java b/services/mogo-service-api/src/main/java/com/mogo/service/adas/IMogoAdasOCHCallback.java
deleted file mode 100644
index 5d87b368d2..0000000000
--- a/services/mogo-service-api/src/main/java/com/mogo/service/adas/IMogoAdasOCHCallback.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.mogo.service.adas;
-
-import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
-
-/**
- * @author congtaowang
- * @since 2021/1/18
- *
- * 自动驾驶到站回调
- */
-public interface IMogoAdasOCHCallback {
-
- /**
- * 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
- */
- int STATUS_AUTOPILOT_DISABLE = 0;
- /**
- * 可自动驾驶,工控机连接正常,且处于人工干预状态
- */
- int STATUS_AUTOPILOT_ENABLE = 1;
- /**
- * 自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
- */
- int STATUS_AUTOPILOT_RUNNING = 2;
-
-
- /**
- * 到站
- *
- * @param data 所到车站的简单信息
- * @see com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener#onAutopilotArriveAtStation
- */
- @Deprecated
- void onArriveAt(AutopilotStationInfo data);
-
- /**
- * 自动驾驶状态发生改变
- *
- * @param state {@link #STATUS_AUTOPILOT_DISABLE}
- * @param reason 不能自动驾驶的原因
- * @see com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener#onAutopilotStatusResponse
- */
- @Deprecated
- void onStateChanged(int state, String reason);
-}
diff --git a/services/mogo-service/build.gradle b/services/mogo-service/build.gradle
index 27baa7d66d..220180a410 100644
--- a/services/mogo-service/build.gradle
+++ b/services/mogo-service/build.gradle
@@ -62,7 +62,6 @@ dependencies {
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_check
} else {
- implementation project(':modules:mogo-module-adas')
api project(":libraries:mogo-map")
implementation project(":libraries:mogo-map-api")
implementation project(':core:mogo-core-utils')
diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
index 035b2e55c8..04c548c34f 100644
--- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
+++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
@@ -15,7 +15,6 @@ import com.mogo.module.adas.AdasProvider;
import com.mogo.module.adas.IAdasDataListener;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.adas.IMogoAdasCarDataCallback;
-import com.mogo.service.adas.IMogoAdasOCHCallback;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
import java.util.List;
@@ -50,8 +49,6 @@ public class MogoADASController implements IMogoADASController {
return satelliteTime;
}
- private final List mAdasOCHCallback = new CopyOnWriteArrayList<>();
-
@Override
public void init(Context context) {
adasProvider = ARouter.getInstance().navigation(AdasProvider.class);
@@ -79,15 +76,6 @@ public class MogoADASController implements IMogoADASController {
}
}
- @Override
- public void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
- DebugConfig.setAutoPilotStatus(autopilotStatus.getState() + "");
- if (!mAdasOCHCallback.isEmpty()) {
- for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
- cb.onStateChanged(autopilotStatus.getState(), autopilotStatus.getReason());
- }
- }
- }
};
adasProvider.addAdasEventListener(mAdasDataListener);
}