replace AdasRecognizedResult data and update CoordiateUtils in sdk
This commit is contained in:
@@ -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