更新绘制marker算法、bugfix

This commit is contained in:
wangcongtao
2021-02-25 21:50:29 +08:00
parent 6f6c2858c9
commit 64c74fb66d
8 changed files with 294 additions and 242 deletions

View File

@@ -133,29 +133,28 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
});
// 每隔一秒下发的数据
MoGoAiCloudRealTime.registerOnMsgListener(new IMogoCloudOnMsgListener() {
@Override
public void onMsgSend(long id) {
}
@Override
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData, false);
}
});
// adas 每隔一秒传递的数据
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback(resultList -> {
double speed = 0.0;
if (MogoServices.getInstance().getLastCarLocation() != null) {
speed = MogoServices.getInstance().getLastCarLocation().getSpeed();
}
// 绘制近景识别到的车辆,每秒绘制一次
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult(resultList, false, speed);
});
}
// 每隔一秒下发的数据
MoGoAiCloudRealTime.registerOnMsgListener(new IMogoCloudOnMsgListener() {
@Override
public void onMsgSend(long id) {
}
@Override
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData, false);
}
});
// adas 每隔一秒传递的数据
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback(resultList -> {
double speed = 0.0;
if (MogoServices.getInstance().getLastCarLocation() != null) {
speed = MogoServices.getInstance().getLastCarLocation().getSpeed();
}
// 绘制近景识别到的车辆,每秒绘制一次
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult(resultList, false, speed);
});
}
/**

View File

@@ -24,6 +24,6 @@ public class SPIRealTimeUpload implements IRealTimeProvider {
@Override
public int getLocationAccuracy() {
return 0;
return SnapshotLocationController.getInstance().getDataAccuracy();
}
}

View File

@@ -47,6 +47,7 @@ class SnapshotLocationController {
private CloudLocationInfo mLastLocationInfo = null;
private List< CloudLocationInfo > mLocationList = new ArrayList<>();
private int mDataAccuracy = 0;
/**
* 同步从定位来的数据也可能是rtk
@@ -81,7 +82,7 @@ class SnapshotLocationController {
double acceleration = data.optDouble( "acceleration", -1 );
double yawRate = data.optDouble( "yawRate", -1 );
double speed = data.optDouble( "speed", -1 );
long satelliteTime = data.optLong( "satelliteTime" );
long satelliteTime = data.optLong( "satelliteTime" );
long systemTime = data.optLong( "systemTime" );
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
@@ -105,25 +106,34 @@ class SnapshotLocationController {
public List< CloudLocationInfo > getSendLocationData() {
List< CloudLocationInfo > list = null;
int dataAccuracy = 0;
if ( mMachineCacheList != null ) {
dataAccuracy = 1;
mDataAccuracy = 1;
list = new ArrayList<>( mMachineCacheList );
mMachineCacheList.clear();
}
if ( list == null || list.isEmpty() ) {
dataAccuracy = 0;
mDataAccuracy = 0;
if ( mLocationList != null ) {
list = new ArrayList<>( mLocationList );
mLocationList.clear();
}
}
if ( list == null ) {
if ( list == null || list.isEmpty() ) {
if ( mLastLocationInfo != null ) {
list = new ArrayList();
list.add( mLastLocationInfo );
mLastLocationInfo = null;
}
}
return list;
}
/**
* 数据精度类型,目前按照数据来源标志
*
* @return
*/
public int getDataAccuracy() {
return mDataAccuracy;
}
}