replace AdasRecognizedResult data and update CoordiateUtils in sdk
This commit is contained in:
@@ -155,19 +155,19 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_NETWORK_VERSION=1.0.40-SNAPSHOT
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_PASSPORT_VERSION=1.0.40-SNAPSHOT
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_SOCKET_VERSION=1.0.40-SNAPSHOT
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_REALTIME_VERSION=1.0.40-SNAPSHOT
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_TANLU_VERSION=1.0.40-SNAPSHOT
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_LIVE_VERSION=1.0.40-SNAPSHOT
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.39-SNAPSHOT
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.40-SNAPSHOT
|
||||
|
||||
######## Foundation MogoAiCloud Module
|
||||
# mogoAiCloud apk services
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -40,6 +40,8 @@ dependencies {
|
||||
api rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
api rootProject.ext.dependencies.mogoaicloudrealtime
|
||||
api rootProject.ext.dependencies.fresco
|
||||
api 'com.mogo.module:module-crash-warning:1.1.0'
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.service.adas;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -113,7 +113,7 @@ public interface IMogoADASController extends IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List< ADASRecognizedResult > getLastADASRecognizedResult();
|
||||
List<ADASRecognizedResult> getLastADASRecognizedResult();
|
||||
|
||||
/**
|
||||
* 添加adas识别物体回调
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,5 +16,5 @@ public interface IMogoAdasRecognizedDataCallback {
|
||||
*
|
||||
* @param resultList 具体识别的物体数据
|
||||
*/
|
||||
void onAdasDataCallback( List< ADASRecognizedResult > resultList );
|
||||
void onAdasDataCallback( List<ADASRecognizedResult> resultList );
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package com.mogo.service.adas.entity;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
* adas 识别物体参数
|
||||
*/
|
||||
class ADASRecognizedResult {
|
||||
|
||||
/**
|
||||
* 识别物体类型
|
||||
*/
|
||||
public int type;
|
||||
|
||||
/**
|
||||
* 识别物体唯一标识
|
||||
*/
|
||||
public String uuid;
|
||||
|
||||
/**
|
||||
* 红绿灯颜色
|
||||
*/
|
||||
public String color;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String carId;
|
||||
|
||||
/**
|
||||
* 识别物体的纬度
|
||||
*/
|
||||
public double lat;
|
||||
|
||||
/**
|
||||
* 识别物体的经度
|
||||
*/
|
||||
public double lon;
|
||||
|
||||
/**
|
||||
* 朝向
|
||||
*/
|
||||
public double heading;
|
||||
|
||||
/**
|
||||
* 系统时间
|
||||
*/
|
||||
public long systemTime;
|
||||
|
||||
/**
|
||||
* 定位卫星时间
|
||||
*/
|
||||
public long satelliteTime;
|
||||
|
||||
/**
|
||||
* 海拔
|
||||
*/
|
||||
public double alt;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
*/
|
||||
public double speed;
|
||||
|
||||
/**
|
||||
* 莫顿码
|
||||
*/
|
||||
public long mortonCode;
|
||||
|
||||
/**
|
||||
* x 轴距离
|
||||
*/
|
||||
public double distanceX;
|
||||
|
||||
/**
|
||||
* y 轴距离
|
||||
*/
|
||||
public double distanceY;
|
||||
|
||||
/**
|
||||
* 实际直线距离
|
||||
*/
|
||||
public double distance;
|
||||
|
||||
/**
|
||||
* 数据来源精度 0 - 普通定位、1 - 高精定位
|
||||
*/
|
||||
public int dataAccuracy;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import com.mogo.commons.utils.MortonCode;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.utils.CoordinateUtils;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
|
||||
@@ -11,7 +11,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
@@ -27,7 +27,7 @@ class AdasObjectUtils {
|
||||
warnMessage.content = info.getContent();
|
||||
warnMessage.level = info.getLevel();
|
||||
try {
|
||||
warnMessage.type = Integer.valueOf( info.getType() );
|
||||
warnMessage.type = Integer.parseInt( info.getType() );
|
||||
} catch ( NumberFormatException e ) {
|
||||
return null;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class AdasObjectUtils {
|
||||
return warnMessage;
|
||||
}
|
||||
|
||||
public static List< ADASRecognizedResult > regroupData( List< AdasAIDLOwnerCarRectModel > datums ) {
|
||||
public static List<ADASRecognizedResult> regroupData(List< AdasAIDLOwnerCarRectModel > datums ) {
|
||||
if ( datums == null || datums.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class AdasObjectUtils {
|
||||
ADASRecognizedResult result = new ADASRecognizedResult();
|
||||
result.uuid = model.getUuid();
|
||||
|
||||
double amapCoord[] = CoordinateUtils.transformWgsToGcj( model.getLat(), model.getLon() );
|
||||
double[] amapCoord = CoordinateUtils.transformWgsToGcj( model.getLat(), model.getLon() );
|
||||
if ( amapCoord != null ) {
|
||||
result.lat = amapCoord[1];
|
||||
result.lon = amapCoord[0];
|
||||
@@ -67,10 +67,10 @@ class AdasObjectUtils {
|
||||
result.lat = model.getLat();
|
||||
result.lon = model.getLon();
|
||||
}
|
||||
result.type = Integer.valueOf( model.getType() );
|
||||
result.type = Integer.parseInt( model.getType() );
|
||||
result.heading = model.getHeading();
|
||||
result.systemTime = Long.valueOf( model.getSystemTime() );
|
||||
result.satelliteTime = Long.valueOf( model.getSatelliteTime() );
|
||||
result.systemTime = Long.parseLong( model.getSystemTime() );
|
||||
result.satelliteTime = Long.parseLong( model.getSatelliteTime() );
|
||||
result.alt = model.getAlt();
|
||||
result.color = model.getColor();
|
||||
result.speed = model.getSpeed();
|
||||
|
||||
@@ -13,6 +13,7 @@ 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.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.adas.IMogoAdasCarDataCallback;
|
||||
@@ -22,7 +23,6 @@ import com.mogo.service.adas.IMogoAdasRecognizedDataCallback;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.service.adas.entity.AdasOCHData;
|
||||
import com.mogo.service.adas.entity.CarModelListResponse;
|
||||
@@ -57,7 +57,6 @@ import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@@ -85,7 +84,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
public static final String VAL_OPEN = "打开";
|
||||
public static final String VAL_CLOSE = "关闭";
|
||||
|
||||
private IMogoStatusManager mStatusManager = SingletonsHolder.get( IMogoStatusManager.class );
|
||||
private final IMogoStatusManager mStatusManager = SingletonsHolder.get( IMogoStatusManager.class );
|
||||
|
||||
private boolean mIsReleased = true;
|
||||
|
||||
@@ -94,23 +93,23 @@ public class MogoADASController implements IMogoADASController {
|
||||
/**
|
||||
* 获取adas前车距离
|
||||
*/
|
||||
private List< IMogoAdasDataCallback > mAdasDataCallbackList = new CopyOnWriteArrayList<>();
|
||||
private final List< IMogoAdasDataCallback > mAdasDataCallbackList = new CopyOnWriteArrayList<>();
|
||||
|
||||
/**
|
||||
* adas 报警数据回调
|
||||
*/
|
||||
private List< IMogoAdasWarnMessageCallback > mMogoAdasWarnMessageCallbackList = new CopyOnWriteArrayList<>();
|
||||
private final List< IMogoAdasWarnMessageCallback > mMogoAdasWarnMessageCallbackList = new CopyOnWriteArrayList<>();
|
||||
|
||||
/**
|
||||
* adas 识别物体回调
|
||||
*/
|
||||
private List< IMogoAdasRecognizedDataCallback > mMogoAdasRecognizedDataCallbacks = new CopyOnWriteArrayList<>();
|
||||
private final List< IMogoAdasRecognizedDataCallback > mMogoAdasRecognizedDataCallbacks = new CopyOnWriteArrayList<>();
|
||||
|
||||
private IMogoAdasCarDataCallback mMogoAdasCarDataCallback;
|
||||
|
||||
private List< AdasAIDLOwnerCarRectModel > mLastFrameData;
|
||||
|
||||
private OnAdasListener mOnAdasListener = new OnAdasListenerAdapter() {
|
||||
private final OnAdasListener mOnAdasListener = new OnAdasListenerAdapter() {
|
||||
|
||||
@Override
|
||||
public void onRectData( RectInfo rectInfo ) {
|
||||
@@ -131,11 +130,9 @@ public class MogoADASController implements IMogoADASController {
|
||||
return;
|
||||
}
|
||||
UiThreadHandler.post( () -> {
|
||||
Iterator< IMogoAdasWarnMessageCallback > iMogoAdasWarnMessageCallbackIterator = mMogoAdasWarnMessageCallbackList.iterator();
|
||||
while ( iMogoAdasWarnMessageCallbackIterator.hasNext() ) {
|
||||
IMogoAdasWarnMessageCallback callback = iMogoAdasWarnMessageCallbackIterator.next();
|
||||
if ( callback != null ) {
|
||||
callback.onReceiveData( warnMessage );
|
||||
for (IMogoAdasWarnMessageCallback callback : mMogoAdasWarnMessageCallbackList) {
|
||||
if (callback != null) {
|
||||
callback.onReceiveData(warnMessage);
|
||||
}
|
||||
}
|
||||
} );
|
||||
@@ -160,8 +157,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
private void invokeCallbackPerSecond( List< AdasAIDLOwnerCarRectModel > models ) {
|
||||
List< AdasAIDLOwnerCarRectModel > newRef = models;
|
||||
List< ADASRecognizedResult > recognizedListResults = AdasObjectUtils.regroupData( newRef );
|
||||
List<ADASRecognizedResult> recognizedListResults = AdasObjectUtils.regroupData(models);
|
||||
if ( !mMogoAdasRecognizedDataCallbacks.isEmpty() ) {
|
||||
for ( IMogoAdasRecognizedDataCallback callback : mMogoAdasRecognizedDataCallbacks ) {
|
||||
if ( callback == null ) {
|
||||
@@ -624,7 +620,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
try {
|
||||
List< AdasAIDLOwnerCarRectModel > data = new ArrayList<>( mLastFrameData );
|
||||
mLastFrameData = null;
|
||||
List< ADASRecognizedResult > recognizedResultList = null;
|
||||
List< ADASRecognizedResult > recognizedResultList;
|
||||
recognizedResultList = AdasObjectUtils.regroupData( data );
|
||||
return recognizedResultList;
|
||||
} catch ( Exception e ) {
|
||||
|
||||
Reference in New Issue
Block a user