Merge branch 'dev_robotaxi-d_230912_6.1.0' into dev_minibus-d_230919_6.1.0

This commit is contained in:
yangyakun
2023-09-25 19:57:50 +08:00
1555 changed files with 78015 additions and 7918 deletions

View File

@@ -61,7 +61,8 @@ dependencies {
exclude group: 'com.zhidaoauto.machine', module: 'map'
}
implementation rootProject.ext.dependencies.mogocustommap
// implementation rootProject.ext.dependencies.mogocustommap
implementation project(':libraries:mapmodule')
implementation rootProject.ext.dependencies.amapnavi3dmap
implementation rootProject.ext.dependencies.androidxroomruntime

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.map.MapDataWrapper
@Route(path = MogoServicePaths.PATH_MAP_BIZ)
class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
@@ -21,6 +22,7 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
get() = "MapBizProvider"
override fun init(context: Context?) {
MapDataWrapper.init()
MapIdentifySubscriber.instance
MogoRouteOverlayManager.getInstance().init()
MapPointCloudSubscriber.instance

View File

@@ -9,13 +9,13 @@ import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
import com.mogo.eagle.core.function.api.map.angle.*
import com.mogo.eagle.core.function.api.map.angle.Scene
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
import com.mogo.eagle.core.utilcode.kotlin.*
import com.zhidaoauto.map.data.road.StopLine
import com.zhidaoauto.map.sdk.open.tools.*
import kotlinx.coroutines.*
import kotlinx.coroutines.android.*
@@ -90,11 +90,11 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
override fun onStopLineInfo(info: StopLine) {
Log.d(TAG, "-- onStopLineInfo --: ${info.distanceOfCarToStopLine}")
if (!hasCrossRoad && info.distanceOfCarToStopLine <= 30.0) {
Log.d(TAG, "-- onStopLineInfo --: ${info.distance}")
if (!hasCrossRoad && info.distance <= 30.0) {
hasCrossRoad = true
triggerRoadId.set(this.roadId.get())
distanceOfCarToStopLine.set(info.distanceOfCarToStopLine)
distanceOfCarToStopLine.set(info.distance)
triggerLocation.set(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02())
changeAngle(CrossRoad(true))
}

View File

@@ -5,9 +5,9 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListener
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
import java.math.BigDecimal
/**
@@ -47,26 +47,20 @@ class MapPointCloudSubscriber private constructor()
if (!isDrawPointCloud) {
CallerLogger.d(M_MAP + TAG, "====开启点云渲染====")
isDrawPointCloud = true
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(true)
}
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(true) //打开点云绘制
/**
* 更新点云数据
* @param dataStr 点云数据
* @param isTrasformer 是否需要转换坐标
* @param isResidual 是否需要差量更新
* @param isStrong 是否加粗显示
* @return 是否执行
*/
CallerLogger.d(M_MAP + TAG, "====开始传入地图点云数据====")
val result = PointCloudHelper.updatePointCloudDataByPb(pointCloud, true, false, false)
val result = CallerMapUIServiceManager.getMapUIController()?.updatePointCloud(pointCloud,
isTransformer = true, isResidual = false, isReset = false
)
CallerLogger.d(M_MAP + TAG, "====结束传入地图点云数据=====$result")
} else {
if (isDrawPointCloud) {
CallerLogger.d(M_MAP + TAG, "====停止点云绘制====")
isDrawPointCloud = false
PointCloudHelper.setIsDrawPointCloud(false)//停止点云绘制
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(false)//停止点云绘制
}
}
} catch (e: Exception) {

View File

@@ -1,15 +1,12 @@
package com.mogo.eagle.core.function.business;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
import com.mogo.map.MapDataWrapper;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
@@ -18,11 +15,9 @@ import java.util.TimerTask;
*
* @author mogoauto
*/
public class SpeedLimitDataManager implements IMoGoChassisLocationWGS84Listener {
public class SpeedLimitDataManager {
private final static String TAG = "SpeedLimitDataManager";
private static volatile SpeedLimitDataManager instance;
private volatile MogoLocation mLocation;
private SpeedLimitDataManager() {
}
@@ -38,31 +33,26 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationWGS84Listener
return instance;
}
@Override
public void onChassisLocationWGS84(@Nullable MogoLocation gnssInfo) {
mLocation = gnssInfo;
}
private class SpeedTimerTask extends TimerTask {
private static class SpeedTimerTask extends TimerTask {
@Override
public void run() {
if (mLocation != null) {
if (CallerMapUIServiceManager.INSTANCE.getMapUIController() != null) {
getSpeedLimit();
}
}
getSpeedLimit();
}
private void getSpeedLimit() {
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
if (speedLimit > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP);
MogoLocation loc = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84();
if (loc.getLatitude() > 0 && loc.getLongitude() > 0) {
MapDataWrapper.INSTANCE.getLimitSpeed(loc.getLongitude(), loc.getLatitude(), (float) loc.getHeading(), integer -> {
if (integer != null && integer > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(integer, DataSourceType.MAP);
}
return null;
});
}
}
}
public void start() {
CallerChassisLocationWGS84ListenerManager.INSTANCE.addListener(TAG, this);
Timer mTimer = new Timer();
mTimer.schedule(new SpeedTimerTask(), 3000, 1000);
}

View File

@@ -38,8 +38,8 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.updateLong
import com.mogo.eagle.core.function.utils.MapBizTrace
import com.mogo.eagle.core.function.utils.MapBizTrace.Companion.getCurrentCNode
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.map.MogoMapUIController
import com.mogo.map.uicontroller.VisualAngleMode
import com.zhidaoauto.map.data.point.LonLatPoint
import com.zhjt.service.chain.ChainLog
import mogo.telematics.pad.MessagePad
import mogo.yycp.api.proto.SocketDownData
@@ -179,8 +179,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
MapIdentifySubscriber.instance.clearAiCloudRoma()
// 主动关闭roma回到中景视角
if (manual) {
MogoMapUIController.getInstance()
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
CallerMapUIServiceManager.getMapUIController()?.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
}
}
@@ -216,7 +215,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
)
if (dataReceive) {
// 请求地图开始漫游
MogoMapUIController.getInstance().setRomaMode(FunctionBuildConfig.romaModeStyle)
CallerMapUIServiceManager.getMapUIController()?.setRomaMode(FunctionBuildConfig.romaModeStyle)
}else{
// 保底清除策略
MapBizTrace.log("",CHAIN_CODE_ROMA_REQUEST_DELAY,TAG,mutableMapOf("delay" to true),true)
@@ -321,28 +320,24 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
globalPathResp?.let {
if (it.wayPointsList != null && it.wayPointsList.size > 0) {
val builder = StringBuilder()
val roamList = ArrayList<LonLatPoint>()
it.wayPointsList.forEach { loc ->
builder.append(loc.longitude).append(",").append(loc.latitude).append(",")
roamList.add(LonLatPoint(loc.longitude,loc.latitude))
}
var romaRoute = builder.toString()
if (romaRoute.endsWith(",")) {
romaRoute = romaRoute.substring(0, builder.toString().length - 1)
}
updateRomaStyle(false, romaRoute)
updateRomaStyle(false, roamList)
}
}
}
private fun updateRomaStyle(auto: Boolean, route: String? = null) {
private fun updateRomaStyle(auto: Boolean, routeList: ArrayList<LonLatPoint>? = null) {
MapBizTrace.log(
"",
CHAIN_CODE_ROMA_ROUTE_MODE,
TAG,
"updateRomaStyle auto status:$auto, route:${route ?: "reset null"}"
"updateRomaStyle auto status:$auto, route:${routeList?.size ?: "reset null"}"
)
route?.let {
CallerMapUIServiceManager.getMapUIController()?.setRoamTrajectory(route)
routeList?.let {
CallerMapUIServiceManager.getMapUIController()?.setRoamTrajectory(it)
}
if (auto) {
FunctionBuildConfig.romaModeStyle = 0

View File

@@ -1,58 +1,51 @@
package com.mogo.eagle.core.function.business.cachemap
import android.util.Log
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.map.hdcache.IHdCacheListener
import com.mogo.map.MogoData.Companion.mogoMapData
object CacheHDMapManager: IMoGoChassisLocationWGS84Listener {
object CacheHDMapManager {
private const val TAG = "CacheHDMapManager"
@Volatile
private var location: MogoLocation? = null
fun scheduleGetLocation() {
if (!AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
ThreadUtils.getIoPool().execute {
if (!CallerMapUIServiceManager.isCityDataCached()) {
while (true) {
if (location != null) {
Log.d(TAG, "开始下载")
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
Log.d(TAG, "下载进度:${progress.toInt()}")
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {
Log.d(TAG, "下载失败")
}
}
}, location!!)
Log.d(TAG, "移除监听并关闭循环")
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
return@execute
mogoMapData.get()?.isCityDataCached {
if (!it) {
ThreadUtils.getIoPool().execute {
while (true) {
val loc =
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
if (loc.latitude != 0.0 || loc.longitude != 0.0) {
CallerLogger.d(TAG, "开始下载")
mogoMapData.get()?.cacheHDDataByCityByLonLat(loc,
{ _, progress ->
CallerLogger.i(M_MAP + TAG, "下载进度:${progress.toInt()}")
},
{ _, state ->
if (state == 0) {
CallerLogger.i(M_MAP + TAG, "下载失败")
}
})
CallerLogger.i(M_MAP + TAG, "移除监听并关闭循环")
break
}
try {
CallerLogger.i(M_MAP + TAG, "开始休眠...")
Thread.sleep(1500)
} catch (e: Exception) {
}
}
try {
Log.d(TAG, "开始休眠...")
Thread.sleep(1500)
} catch (e: Exception) {}
}
} else {
Log.d(TAG, "高精地图缓存已下载!")
CallerLogger.i(M_MAP + TAG, "高精地图缓存已下载!")
}
}
}
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
location = gnssInfo
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import androidx.collection.ArraySet
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.map.identify.MogoIdentifyManager
import mogo.yycp.api.proto.SocketDownData
@@ -10,10 +9,6 @@ import java.util.concurrent.ConcurrentHashMap
class IdentifyAiCloudDataDrawer : Identify {
companion object {
private const val TAG = "IdentifyDataDrawer"
}
/**
* 上一帧数据的缓存
*/
@@ -55,14 +50,14 @@ class IdentifyAiCloudDataDrawer : Identify {
val key = it.next() as String
it.remove()
mMarkersCaches.remove(key)
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(key.hashCode().toString())
}
val filterList = filterTrafficData(resultList)
if (filterList.size > 0) {
// 绘制新数据
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.updateBatchAiMarkerPosition(filterList)
}
}
@@ -90,7 +85,7 @@ class IdentifyAiCloudDataDrawer : Identify {
trafficDataUuidList.clear()
mMarkersCaches.forEach { (uuid, _) ->
mMarkersCaches.remove(uuid)
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(uuid.hashCode().toString())
}
mFilterTrafficData.clear()

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.map.identify.MogoIdentifyManager
@@ -13,10 +12,6 @@ import mogo.telematics.pad.MessagePad.TrackedObject
*/
class IdentifyBeautifyDataDrawer : Identify {
companion object {
private const val TAG = "IdentifyDataDrawer"
}
override fun renderPlanningWarningObj(planningObjects: List<MessagePad.PlanningObject>?) {
TrackManager.getInstance().renderPlanningWarningObj(planningObjects)
}
@@ -46,7 +41,7 @@ class IdentifyBeautifyDataDrawer : Identify {
val filterList = TrackManager.getInstance().filterTrafficData(resultList)
if (filterList.size > 0) {
// 绘制新数据
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.updateBatchMarkerPosition(filterList)
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import androidx.collection.ArraySet
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.map.identify.MogoIdentifyManager
@@ -17,10 +16,6 @@ import java.util.concurrent.ConcurrentHashMap
*/
class IdentifyOriginDataDrawer : Identify {
companion object {
private const val TAG = "IdentifyDataDrawer"
}
/**
* 上一帧数据的缓存
*/
@@ -65,11 +60,11 @@ class IdentifyOriginDataDrawer : Identify {
//清除缓存
for (data in resultList) {
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) {
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains(data.uuid.toString())) {
if (TrackerSourceFilterHelper.filterData(data)) {
continue
}
trafficDataUuidList.remove("" + data.uuid)
trafficDataUuidList.remove(data.uuid.toString())
}
}
@@ -79,14 +74,14 @@ class IdentifyOriginDataDrawer : Identify {
val key = it.next() as String
it.remove()
mMarkersCaches.remove(key)
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(key)
}
val filterList = filterTrafficData(resultList)
if (filterList.size > 0) {
// 绘制新数据
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.updateBatchMarkerPosition(filterList)
}
}
@@ -105,7 +100,7 @@ class IdentifyOriginDataDrawer : Identify {
continue
}
var temp: TrackedObject = data
val uuid = "" + data.uuid
val uuid = data.uuid.toString()
val cacheData = mMarkersCaches[uuid]
if (cacheData != null) {
val color = TrackerSourceFilterHelper.getDefaultColor(data)
@@ -124,7 +119,7 @@ class IdentifyOriginDataDrawer : Identify {
@SuppressLint("NewApi")
override fun clearOldMarker() {
for (uuid in trafficDataUuidList) {
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(uuid)
}
trafficDataUuidList.clear()

View File

@@ -1,11 +1,13 @@
package com.mogo.eagle.core.function.business.identify;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.ArraySet;
import androidx.annotation.RequiresApi;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
@@ -71,13 +73,13 @@ public class TrackManager {
public HashMap<String, MessagePad.TrackedObject> filterTrafficData(List<MessagePad.TrackedObject> trafficData) {
//清空上次返回数据,做到缓存复用
mFilterTrafficData.clear();
long cost = System.currentTimeMillis();
// long cost = System.currentTimeMillis();
//进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid
for (MessagePad.TrackedObject data : trafficData) {
if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) {
continue;
}
String uuid = "" + data.getUuid();
String uuid = Integer.toString(data.getUuid());
TrackObj trackObj = mMarkersCaches.get(uuid);
String color = TrackerSourceFilterHelper.INSTANCE.getDefaultColor(data);
@@ -93,24 +95,26 @@ public class TrackManager {
if (cellIdCaches.containsValue(pos)) {
String findSameValue = cellIdCaches.inverse().get(pos);
//uuid处理
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
if (cacheTrack != null) {
trackObj = cacheTrack;
MessagePad.TrackedObject cache = cacheTrack.getCache();
if (cache != null) {
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
if (cacheTrack.relativeStatic()) {
if (data.getColor() != null && !data.getColor().isEmpty()) {
cache = cache.toBuilder().setColor(data.getColor()).build();
if(findSameValue != null && !findSameValue.isEmpty()){
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
if (cacheTrack != null) {
trackObj = cacheTrack;
MessagePad.TrackedObject cache = cacheTrack.getCache();
if (cache != null) {
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
if (cacheTrack.relativeStatic()) {
if (data.getColor() != null && !data.getColor().isEmpty()) {
cache = cache.toBuilder().setColor(data.getColor()).build();
}
data = cache;
}
data = cache;
}
uuid = findSameValue;
trackObj.updateObj(data);
} else {
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
uuid = findSameValue;
trackObj.updateObj(data);
} else {
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
} else {
trackObj = new TrackObj(data,s2CellId,s2LatLng);
@@ -128,7 +132,7 @@ public class TrackManager {
public void clearCache(List<MessagePad.TrackedObject> resultList) {
//过滤现有元素
for (MessagePad.TrackedObject data : resultList) {
String uuid = "" + data.getUuid();
String uuid = Integer.toString(data.getUuid());
if (trafficDataUuid.size() > 0 && trafficDataUuid.contains(uuid)) {
if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) {
continue;
@@ -150,17 +154,18 @@ public class TrackManager {
cellIdCaches.remove(key);
mMarkersCaches.remove(key);
WarningHelper.INSTANCE.remove(key);
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(key);
}
@RequiresApi(api = Build.VERSION_CODES.N)
public void clearAll() {
cellIdCaches.clear();
trafficDataUuid.clear();
WarningHelper.INSTANCE.clear();
mMarkersCaches.forEach((uuid, trackObj) -> {
trackObj.clear();
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(uuid);
});
mMarkersCaches.clear();

View File

@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import mogo.telematics.pad.MessagePad.*
object TrackerSourceFilterHelper {
@@ -12,7 +11,8 @@ object TrackerSourceFilterHelper {
@SuppressLint("NewApi")
fun filterData(data: TrackedObject): Boolean {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && (data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)) {
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)
) {
return true
}
var trackIPCFilter = true
@@ -32,7 +32,7 @@ object TrackerSourceFilterHelper {
}
}
4 -> {
if(isV2nRSM(data).second){
if (isV2nRSM(data).second) {
trackIPCFilter = false
}
}
@@ -73,12 +73,10 @@ object TrackerSourceFilterHelper {
}
//僵尸车
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
if (data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE) {
color = "#7A8499FF"
CallerMapUIServiceManager.getMapUIController()?.let {
if(it.isDayMode){
color = "#9BA8BCFF"
}
if (FunctionBuildConfig.skinMode == 1) {
color = "#9BA8BCFF"
}
//消息埋点
CallerFuncBizListenerManager.invokeAttrZombieAnalyticsEvent()

View File

@@ -41,7 +41,7 @@ object WarningHelper {
return
}
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
val trackId = "" + planningObj.uuid
val trackId = planningObj.uuid.toString()
if (mMarkersCaches.containsKey(trackId)) {
mMarkersCaches[trackId] ?: return@Consumer
if (planningObj.type == 0) { //0是leading障碍物障碍物车身红色提示
@@ -72,7 +72,7 @@ object WarningHelper {
return
}
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
val trackId = "" + planningObj.uuid
val trackId = planningObj.uuid.toString()
if (mMarkersCaches.containsKey(trackId)) {
mMarkersCaches[trackId] ?: return@Consumer
if (planningObj.type == 0) { //0是leading障碍物障碍物车身红色提示

View File

@@ -58,7 +58,7 @@ public class MogoRouteOverlayManager implements
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> items) {
Log.d(TAG, "-- onAutopilotTrajectory --: " + (items != null ? items.size() : "0"));
// Log.d(TAG, "-- onAutopilotTrajectory --: " + (items != null ? items.size() : "0"));
synchronized (queue) {
queue.clear();
queue.offer(items);
@@ -72,18 +72,18 @@ public class MogoRouteOverlayManager implements
}
int autoPilotState = CallerAutoPilotStatusListenerManager.INSTANCE.getState();
boolean isArriveAtStation = CallerAutoPilotStatusListenerManager.INSTANCE.isArriveAtStation();
Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
if (isArriveAtStation && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
if (!force && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 3 ---");
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 3 ---");
synchronized (queue) {
if (!queue.isEmpty()) {
List<MessagePad.TrajectoryPoint> items = queue.pollLast();

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.business.routeoverlay;
import static com.mogo.map.MogoMap.DEFAULT;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Handler;
@@ -197,7 +199,7 @@ public class RouteOverlayDrawer {
if (mPolylineOptions == null) {
mPolylineOptions = options;
}
overlayManager.showOrUpdateLine(options);
overlayManager.showOrUpdateLine(options,DEFAULT);
} else {
isExcept = true;
}

View File

@@ -1,43 +0,0 @@
package com.mogo.eagle.core.function.impl;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.map.IMogoMapService;
import com.mogo.map.MoGoOverlayManager;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.location.GDLocationClient;
import com.mogo.map.location.IMogoGDLocationClient;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.map.uicontroller.IMogoMapUIController;
/**
* @author congtaowang
* @since 2019-12-18
* <p>
* 地图对外地接口
*/
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
public class MogoMapService implements IMogoMapService {
@Override
public IMogoMapUIController getMapUIController() {
return MogoMapUIController.getInstance();
}
@Override
public IMoGoOverlayManager getOverlayManager() {
return MoGoOverlayManager.INSTANCE.overlay();
}
@Override
public IMogoGDLocationClient getGDLocationServer(Context context) {
return GDLocationClient.getInstance(context);
}
@Override
public void init(Context context) {
}
}

View File

@@ -0,0 +1,37 @@
package com.mogo.eagle.core.function.impl
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.map.MoGoOverlayManager.overlay
import com.mogo.map.location.GDLocationClient.Companion.gdLocationClient
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.map.IMogoMapService
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.map.overlay.IMoGoOverlayManager
import com.mogo.map.MogoMap.Companion.mapInstance
import com.mogo.map.location.IMogoGDLocationClient
/**
* @author congtaowang
* @since 2019-12-18
*
*
* 地图对外地接口,多实例情况下,如果某个业务需要在多个地图上展示,需要业务提供监听接口,各个地图实例监听实现
*/
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
class MogoMapService : IMogoMapService {
override fun getMapUIController(mapTag:String): IMogoMapUIController? {
return mapInstance.getMogoMap().uiController
}
override fun getOverlayManager(): IMoGoOverlayManager {
return overlay()
}
override fun getGDLocationServer(): IMogoGDLocationClient {
return gdLocationClient
}
override fun init(context: Context) {}
}

View File

@@ -11,9 +11,13 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.map.MogoMapView
import com.mogo.map.overlay.line.Polyline
import com.mogo.map.overlay.point.Point
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay
import com.mogo.map.overlay.proxy.point.IMapPointOverlay
import com.mogo.map.uicontroller.IMogoMapUIController
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
@@ -28,7 +32,6 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
super.onCreate(bundle)
map?.uiController?.showMyLocation(true)
initMapView()
CallerSkinModeListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, 20,this)
CallerChassisLamplightListenerManager.addListener(TAG, this)
@@ -48,7 +51,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
//设置旋转手势是否可用。
it.setRotateGesturesEnabled(false)
//设置比例尺控件是否可见
it.setScaleControlsEnabled(true)
it.setScaleControlsEnabled(false)
//设置拖拽手势是否可用。
it.setScrollGesturesEnabled(true)
//设置倾斜手势是否可用。
@@ -60,7 +63,19 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
}
}
override fun onSaveInstanceState(outState: Bundle?) {
fun getUI(): IMogoMapUIController? {
return map?.uiController
}
fun addLine(options:Polyline.Options): IMapPolylineOverlay? {
return map?.addLine(options)
}
fun addPoint(options: Point.Options): IMapPointOverlay?{
return map?.addPoint(options)
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
}
@@ -74,9 +89,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
override fun onSkinModeChange(skinMode: Int) {
if (skinMode == 0) {
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(false)
getUI()?.stepInDayMode(false)
} else if (skinMode == 1) {
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(true)
getUI()?.stepInDayMode(true)
}
}
@@ -107,9 +122,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
private fun turn(lightNum: Int) {
if (currentLevel != lightNum) {
when (lightNum) {
0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(1, 500)
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
0 -> getUI()?.setCarLightsType(0, 500)
1 -> getUI()?.setCarLightsType(1, 500)
2 -> getUI()?.setCarLightsType(2, 500)
}
currentLevel = lightNum
}