Merge branch 'dev_MogoAP_eagle-930_210926_8.0.12' into dev_MogoAP_eagle-1030_211020_8.0.14
# Conflicts: # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt # gradle.properties # modules/mogo-module-adas/build.gradle # modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java # modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java # services/mogo-service-api/src/main/java/com/mogo/service/adas/IMogoADASController.java # services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
This commit is contained in:
@@ -3,6 +3,8 @@ package com.mogo.module.adas;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
|
||||
@@ -22,6 +24,18 @@ import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
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.TrajectoryInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo;
|
||||
import com.zhidao.support.adas.high.common.MsgActionType;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -104,6 +118,18 @@ public class AdasEventManager implements
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(List<TrajectoryInfo> trajectoryList) {
|
||||
// Log.e("lianglihui","adas onAutopilotTrajectory");
|
||||
if(trajectoryList != null && trajectoryList.size() >0){
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onAutopilotTrajectory(trajectoryList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest() {
|
||||
if (providerBizListener != null) {
|
||||
@@ -113,6 +139,11 @@ public class AdasEventManager implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(AutopilotGuardianInfo guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebSocketConnectSuccess() {
|
||||
Logger.d(TAG, "webSocket 连接成功");
|
||||
|
||||
@@ -4,6 +4,17 @@ 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.module.adas.entity.WarnMessageModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarStateModel;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.TrajectoryInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IAdasDataListener {
|
||||
@@ -50,4 +61,13 @@ public interface IAdasDataListener {
|
||||
default void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 车前引导路径回调
|
||||
* @param trajectory
|
||||
*/
|
||||
|
||||
default void onAutopilotTrajectory(List<TrajectoryInfo> trajectory) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,17 @@ package com.mogo.module.service.routeoverlay;
|
||||
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.adas.IMogoAdasTrajectoryDataCallBack;
|
||||
import com.mogo.service.adas.entity.ADASTrajectoryInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MogoRouteOverlayManager implements IMogoCarLocationChangedListener2 {
|
||||
@@ -29,10 +32,25 @@ public class MogoRouteOverlayManager implements IMogoCarLocationChangedListener2
|
||||
|
||||
@Override
|
||||
public void routeResult(List<MogoLatLng> routeList) {
|
||||
Log.e("lianglihui","routeResult:"+routeList.size());
|
||||
RouteOverlayDrawer.getInstance(mContext).putRouteList(routeList);
|
||||
}
|
||||
});
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasTrajectoryDataCallBack(new IMogoAdasTrajectoryDataCallBack() {
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(List<ADASTrajectoryInfo> trajectoryInfos) {
|
||||
if (trajectoryInfos == null || trajectoryInfos.size() == 0){
|
||||
return;
|
||||
}
|
||||
Log.e("lianglihui","trajectoryInfos:"+trajectoryInfos.size());
|
||||
List<MogoLatLng> mogoLatLngs = new ArrayList<>();
|
||||
for (ADASTrajectoryInfo a:trajectoryInfos) {
|
||||
mogoLatLngs.add(new MogoLatLng(a.getLat(),a.getLon()));
|
||||
}
|
||||
RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(mogoLatLngs);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static MogoRouteOverlayManager getInstance(Context context) {
|
||||
@@ -49,7 +67,7 @@ public class MogoRouteOverlayManager implements IMogoCarLocationChangedListener2
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
updateLocation(latLng);
|
||||
// updateLocation(latLng);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -124,4 +124,21 @@ public class RouteOverlayDrawer {
|
||||
public void putRouteList(List<MogoLatLng> routeList) {
|
||||
this.mRouteList = routeList;
|
||||
}
|
||||
|
||||
public void drawTrajectoryList(List<MogoLatLng> routeList) {
|
||||
clearMogoRouteOverlay();
|
||||
if (routeList != null) {
|
||||
for (MogoLatLng latLng : routeList) {
|
||||
mPolylinePointList.add(latLng);
|
||||
}
|
||||
mPolylineOptions.setGps(true);
|
||||
mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size()));
|
||||
// 替换路径集合
|
||||
mPolylineOptions.points(mPolylinePointList);
|
||||
// 线条粗细,渐变,渐变色值
|
||||
mPolylineOptions.width(25).useGradient(true).colorValues(mPolylineColors);
|
||||
// 绘制线
|
||||
mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user