replace AdasRecognizedResult data and update CoordiateUtils in sdk

This commit is contained in:
zhongchao
2021-02-24 16:21:45 +08:00
parent 14561b90b3
commit 177d31ce7f
10 changed files with 41 additions and 197 deletions

View File

@@ -11,7 +11,7 @@ import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.realtime.entity.ADASRecognizedResult;
import java.util.ArrayList;
import java.util.HashMap;
@@ -30,13 +30,13 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
private static volatile AdasRecognizedResultDrawer sInstance;
private Context mContext;
private final Context mContext;
private AdasRecognizedResultDrawer() {
mContext = AbsMogoApplication.getApp();
}
private Map< String, ADASRecognizedResult > mLastPositions = new ConcurrentHashMap<>();
private final Map< String, ADASRecognizedResult> mLastPositions = new ConcurrentHashMap<>();
public static AdasRecognizedResultDrawer getInstance() {
if ( sInstance == null ) {
@@ -59,7 +59,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
}
// adas marker 缓存
private Map< String, IMogoMarker > mAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
private final Map< String, IMogoMarker > mAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
public boolean hasCached( String uniqueKey ) {
return mAdasRecognizedMarkersCaches.containsKey( uniqueKey );
@@ -131,7 +131,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
/**
* 过滤adas数据中不存在的 marker
*
* @param resultList
* @param resultList ADAS结果集
*/
private void purgeAdasRecognizedData( List< ADASRecognizedResult > resultList ) {
if ( resultList == null || resultList.isEmpty() ) {
@@ -156,7 +156,9 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
mLastPositions.remove( key );
try {
IMogoMarker marker = mAdasRecognizedMarkersCaches.remove( key );
marker.destroy();
if(marker != null){
marker.destroy();
}
} catch ( Exception e ) {
e.printStackTrace();
}

View File

@@ -1,41 +0,0 @@
package com.mogo.module.service.websocket;
import com.mogo.realtime.entity.CloudLocationInfo;
import java.util.List;
public
/*
* @author congtaowang
* @since 2020/10/25
*
* 自车定位信息
*/
class LocationResult {
/**
* sn
*/
public String sn;
/**
* 最后一个定位点的莫顿码
*/
public long mortonCode;
/**
* 最后一个定位点
*/
public CloudLocationInfo lastCoordinate;
/**
* 连续定位点
*/
public List< CloudLocationInfo > coordinates;
/**
* 数据来源精度 0 - 普通定位、1 - 高精定位
*/
public int dataAccuracy = 0;
}

View File

@@ -1,25 +0,0 @@
package com.mogo.module.service.websocket;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import java.util.List;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* 一秒一次的上行数据
*/
class OnePerSecondSendContent {
/**
* 自车定位点
*/
public LocationResult self;
/**
* adas 识别物体1s 识别到的最后帧
*/
public List< ADASRecognizedResult > adas;
}