adas数据获取
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -8,7 +8,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
1
.idea/runConfigurations.xml
generated
1
.idea/runConfigurations.xml
generated
@@ -3,6 +3,7 @@
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
|
||||
@@ -240,7 +240,7 @@ ext {
|
||||
mogoaicloudlive : "com.mogo.cloud:live:${MOGO_LIVE_VERSION}",
|
||||
mogoaicloudrealtime : "com.mogo.cloud:realtime:${MOGO_REALTIME_VERSION}",
|
||||
mogoaicloudtanlu : "com.mogo.cloud:tanlu:${MOGO_TANLU_VERSION}",
|
||||
mogoaicloudtrafficlive : "com.mogo.cloud:trafficlive:${MOGO_TRAFFICLIVE_VERSION}",
|
||||
mogoaicloudtrafficlive : "com.zhidao.support.adas:high:${MOGO_ADASHIGH_VERSION}"
|
||||
]
|
||||
|
||||
}
|
||||
@@ -169,6 +169,8 @@ MOGO_TANLU_VERSION=1.0.71
|
||||
MOGO_LIVE_VERSION=1.0.71
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.71
|
||||
#ADAS HIGHT
|
||||
MOGO_ADASHIGH_VERSION = '1.1.3'
|
||||
|
||||
######## Foundation MogoAiCloud Module
|
||||
# mogoAiCloud apk services
|
||||
|
||||
@@ -45,17 +45,21 @@ dependencies {
|
||||
// 现有的ADAS的通讯SDK,需要将里面的东西融合到我们项目中
|
||||
compileOnly rootProject.ext.dependencies.adasapi
|
||||
|
||||
api "com.zhidao.support.adas:high:1.1.5.9"
|
||||
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
api
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
@@ -11,62 +12,143 @@ import com.zhidao.support.adas.high.bean.ObstaclesInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/4/25 14:43
|
||||
*/
|
||||
public class AdasListenerManager implements OnAdasListener, OnAdasMsgConnectStatusListener {
|
||||
public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusListener {
|
||||
|
||||
private final String TAG = "AdasEventManager";
|
||||
private ArrayList<AdasListenerAdapter> iAdasEventListeners;
|
||||
private ArrayList<AdasStatusListener> iAdasStatusListeners;
|
||||
|
||||
public void addEventListener(AdasListenerAdapter listener) {
|
||||
Logger.d(TAG,"添加adas事件监听");
|
||||
if (iAdasEventListeners == null) {
|
||||
iAdasEventListeners = new ArrayList<AdasListenerAdapter>();
|
||||
}
|
||||
iAdasEventListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeEventListener(AdasListenerAdapter listener) {
|
||||
Logger.d(TAG,"注销adas事件监听");
|
||||
if (iAdasEventListeners != null && iAdasEventListeners.contains(listener)) {
|
||||
iAdasEventListeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
public void addStatusListener(AdasStatusListener listener) {
|
||||
Logger.d(TAG,"添加adas状态事件监听");
|
||||
if (iAdasStatusListeners == null) {
|
||||
iAdasStatusListeners = new ArrayList<AdasStatusListener>();
|
||||
}
|
||||
iAdasStatusListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeStatusListener(AdasStatusListener listener) {
|
||||
Logger.d(TAG,"注销adas状态事件监听");
|
||||
if (iAdasEventListeners != null && iAdasEventListeners.contains(listener)) {
|
||||
iAdasEventListeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
|
||||
Logger.d(TAG,"onWarnMessage");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onWarnMessage(warnMessageInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoSize(int width, int height) {
|
||||
|
||||
Logger.d(TAG,"onVideoSize");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onVideoSize(width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRectData(RectInfo rectInfo) {
|
||||
|
||||
Logger.d(TAG,"onRectData");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onRectData(rectInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarStateData(CarStateInfo carStateInfo) {
|
||||
|
||||
Logger.d(TAG,"onCarStateData");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onCarStateData(carStateInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightStateData(LightStatueInfo lightStatueInfo) {
|
||||
|
||||
Logger.d(TAG,"onLightStateData");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onLightStateData(lightStatueInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
|
||||
|
||||
Logger.d(TAG,"onObstaclesInfo");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onObstaclesInfo(obstaclesInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
|
||||
|
||||
Logger.d(TAG,"onCarLaneInfo");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onCarLaneInfo(carLaneInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.autopilotStatus(autopilotStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotArrive(AutopilotWayArrive autopilotWayArrive) {
|
||||
|
||||
Logger.d(TAG,"autopilotArrive");
|
||||
for (AdasListenerAdapter listener:iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.autopilotArrive(autopilotWayArrive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebSocketConnectSuccess() {
|
||||
|
||||
Logger.d(TAG,"websocket连接成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebSocketConnectFailed() {
|
||||
|
||||
Logger.d(TAG,"websocket连接失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
|
||||
import com.zhidao.support.adas.high.bean.CarLaneInfo;
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo;
|
||||
import com.zhidao.support.adas.high.bean.LightStatueInfo;
|
||||
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/4/25 16:52
|
||||
*/
|
||||
public abstract class AdasListenerAdapter implements OnAdasListener {
|
||||
|
||||
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
|
||||
};
|
||||
|
||||
public void onVideoSize(int width, int height) {
|
||||
|
||||
};
|
||||
|
||||
public void onRectData(RectInfo rectInfo) {
|
||||
|
||||
};
|
||||
|
||||
public void onCarStateData(CarStateInfo carStateInfo){
|
||||
|
||||
};
|
||||
|
||||
public void onLightStateData(LightStatueInfo lightStatueInfo){
|
||||
|
||||
};
|
||||
|
||||
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
|
||||
|
||||
};
|
||||
|
||||
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
|
||||
|
||||
};
|
||||
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
|
||||
};
|
||||
|
||||
public void autopilotArrive(AutopilotWayArrive autopilotWayArrive) {
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
|
||||
/**
|
||||
* ADAS 模块
|
||||
@@ -17,10 +18,40 @@ import com.mogo.service.MogoServicePaths;
|
||||
@Route(path = MogoServicePaths.PATH_ADAS)
|
||||
public class AdasProvider implements IProvider {
|
||||
private final String TAG = "AdasProvider";
|
||||
private AdasEventManager adasEventManager;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Log.d(TAG, "初始化 ADAS 模块");
|
||||
Logger.d(TAG, "初始化 ADAS 模块");
|
||||
|
||||
adasEventManager = new AdasEventManager();
|
||||
initAdas(context, adasEventManager);
|
||||
}
|
||||
|
||||
private void initAdas(Context context, AdasEventManager adasEventManager) {
|
||||
AdasManager.getInstance().create(context);
|
||||
AdasManager.getInstance().setOnAdasListener(adasEventManager);
|
||||
AdasManager.getInstance().setOnAdasConnectStatusListener(adasEventManager);
|
||||
}
|
||||
|
||||
public void addAdasEventListener(AdasListenerAdapter listener) {
|
||||
adasEventManager.addEventListener(listener);
|
||||
}
|
||||
|
||||
public void removeAdasEventListener(AdasListenerAdapter listener) {
|
||||
adasEventManager.removeEventListener(listener);
|
||||
}
|
||||
|
||||
public void addAdaStatusListener(AdasStatusListener listener) {
|
||||
adasEventManager.addStatusListener(listener);
|
||||
}
|
||||
|
||||
public void removeAdasStatusListener(AdasStatusListener listener) {
|
||||
adasEventManager.removeStatusListener(listener);
|
||||
}
|
||||
|
||||
public void sendWsMessage(String msg) {
|
||||
AdasManager.getInstance().aiCloudToAdasData(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 4/28/21 16:19
|
||||
*/
|
||||
public abstract class AdasStatusListener {
|
||||
|
||||
public void onServiceConnected() {
|
||||
|
||||
};
|
||||
public void onServiceDisconnected() {
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/4/25 16:52
|
||||
*/
|
||||
public class IAdasEventListener {
|
||||
}
|
||||
@@ -42,7 +42,7 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.adasapi
|
||||
implementation rootProject.ext.dependencies.adasconfigapi
|
||||
implementation "com.zhidao.support.adas:high:1.1.5.9"
|
||||
implementation project(':modules:mogo-module-adas')
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
|
||||
@@ -10,11 +10,15 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.adas.AdasListenerAdapter;
|
||||
import com.mogo.module.adas.AdasProvider;
|
||||
import com.mogo.module.adas.AdasStatusListener;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
@@ -50,7 +54,6 @@ import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarStateModel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.zhidao.support.adas.high.msg.MyMessageFactory;
|
||||
@@ -58,9 +61,7 @@ import com.zhidao.support.adas.high.msg.MyMessageFactory;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -157,7 +158,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
};
|
||||
|
||||
private final OnAdasListener mOnAdasListener = new OnAdasListenerAdapter() {
|
||||
//private final OnAdasListener mOnAdasListener = new OnAdasListenerAdapter() {
|
||||
private final AdasListenerAdapter mOnAdasListener = new AdasListenerAdapter() {
|
||||
|
||||
@Override
|
||||
public void onRectData( RectInfo rectInfo ) {
|
||||
@@ -294,7 +296,20 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
init( AbsMogoApplication.getApp() );
|
||||
AutopilotServiceManage.getInstance().registerAutopilotServiceStatusListener( new IAutopilotServiceStatusListener() {
|
||||
AdasProvider adasProvider = ARouter.getInstance().navigation(AdasProvider.class);
|
||||
adasProvider.addAdaStatusListener(new AdasStatusListener() {
|
||||
@Override
|
||||
public void onServiceConnected() {
|
||||
super.onServiceConnected();
|
||||
invokeShowADASOperation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected() {
|
||||
super.onServiceDisconnected();
|
||||
}
|
||||
});
|
||||
/*AutopilotServiceManage.getInstance().registerAutopilotServiceStatusListener( new IAutopilotServiceStatusListener() {
|
||||
@Override
|
||||
public void onServiceConnected() {
|
||||
invokeShowADASOperation();
|
||||
@@ -304,7 +319,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void onServiceDisconnected() {
|
||||
|
||||
}
|
||||
} );
|
||||
} );*/
|
||||
invokeShowADASOperation();
|
||||
|
||||
if ( mAutopolitDataCallBack == null ) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import com.mogo.module.adas.AdasListenerAdapter;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
|
||||
|
||||
Reference in New Issue
Block a user