remove truck color problem and add note
This commit is contained in:
@@ -256,10 +256,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制某个物体的一个数据 todo 缓存问题
|
||||
* 绘制某个物体的一个数据
|
||||
*
|
||||
* @param recognizedListResult {@link ADASRecognizedResult}
|
||||
* @param newAdasRecognizedMarkersCaches
|
||||
* @param newAdasRecognizedMarkersCaches 缓存集合
|
||||
*/
|
||||
private void renderAdasOneFrame(IMogoMarker marker,
|
||||
String uniqueKey,
|
||||
@@ -289,9 +289,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon);
|
||||
long cost = System.currentTimeMillis() - start;
|
||||
final long intervalRef = interval - cost;
|
||||
// SimpleHandlerThreadPool.getInstance().postRender(() -> {
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.heading, intervalRef);
|
||||
// });
|
||||
} else {
|
||||
marker.setRotateAngle(((float) recognizedListResult.heading));
|
||||
marker.setPosition(recognizedListResult.lat, recognizedListResult.lon);
|
||||
@@ -310,8 +308,8 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
/**
|
||||
* 绘制 marker
|
||||
*
|
||||
* @param recognizedListResult
|
||||
* @return
|
||||
* @param recognizedListResult {@link ADASRecognizedResult}
|
||||
* @return {@link IMogoMarker}
|
||||
*/
|
||||
private IMogoMarker drawAdasRecognizedDataMarker(ADASRecognizedResult recognizedListResult) {
|
||||
if (recognizedListResult == null) {
|
||||
@@ -355,9 +353,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
if (mMarkersCaches != null) {
|
||||
mMarkersCaches.clear();
|
||||
}
|
||||
if (mLastPositions != null) {
|
||||
mLastPositions.clear();
|
||||
}
|
||||
mLastPositions.clear();
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +211,7 @@ class BaseDrawer {
|
||||
protected String getModelRenderColor(int type, double speed, double lon, double lat, double angle) {
|
||||
|
||||
AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type);
|
||||
if (recognizedType == AdasRecognizedType.classIdTrafficBus) {
|
||||
return "#D8D8D8FF";
|
||||
}
|
||||
if (recognizedType == AdasRecognizedType.classIdUnKnow) { //todo unKnow颜色绘制
|
||||
if (recognizedType == AdasRecognizedType.classIdUnKnow) {
|
||||
return Car3DModelColor.Normal.color;
|
||||
}
|
||||
// 距离策略
|
||||
@@ -355,8 +352,8 @@ class BaseDrawer {
|
||||
/**
|
||||
* 缓存绘制 marker 的 id 和 marker 资源缓存的 md5 的关系
|
||||
*
|
||||
* @param id
|
||||
* @param marker
|
||||
* @param id 缓存资源ID
|
||||
* @param marker {@link IMogoMarker}
|
||||
*/
|
||||
protected static void cacheMarkerIconResMd5Val(String id, IMogoMarker marker) {
|
||||
if (marker == null || marker.isDestroyed()) {
|
||||
@@ -372,11 +369,11 @@ class BaseDrawer {
|
||||
/**
|
||||
* 道路匹配到车道中心点
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param angle
|
||||
* @param isRtk
|
||||
* @return
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 方向角
|
||||
* @param isRtk 是否是RTK
|
||||
* @return 匹配经纬度值
|
||||
*/
|
||||
public double[] matchRoad(String id, double lon, double lat, double angle, boolean isRtk) {
|
||||
final long start = System.currentTimeMillis();
|
||||
@@ -392,20 +389,20 @@ class BaseDrawer {
|
||||
/**
|
||||
* 清理缓存路段数据
|
||||
*
|
||||
* @param id
|
||||
* @param id 缓存数据Key
|
||||
*/
|
||||
public static void clearRoadCacheById(String id) {
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().clearRoadCacheById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用系统时间或卫星时间计算出动画的运动时间
|
||||
* 使用系统时间或卫星时间计算出动画的运动时间,最小值45,防止两个点距离过近设置的最小动画执行时间
|
||||
*
|
||||
* @param lastSystemTime
|
||||
* @param curSystemTime
|
||||
* @param lastSatelliteTime
|
||||
* @param curSatelliteTime
|
||||
* @return
|
||||
* @param lastSystemTime 上一个点系统时间,误差值
|
||||
* @param curSystemTime 当前点系统时间,误差值
|
||||
* @param lastSatelliteTime 上一个点SNTP时间,精确值
|
||||
* @param curSatelliteTime 当前点SNTP时间,精确值
|
||||
* @return 动画运动时间
|
||||
*/
|
||||
public long computeAnimDuration(long lastSystemTime, long curSystemTime, long lastSatelliteTime, long curSatelliteTime) {
|
||||
long systemTimeInterval = curSystemTime - lastSystemTime;
|
||||
@@ -420,13 +417,13 @@ class BaseDrawer {
|
||||
/**
|
||||
* 根据位置信息、车头朝向计算道路吸附
|
||||
*
|
||||
* @param id
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param heading
|
||||
* @param lastLon
|
||||
* @param lastLat
|
||||
* @return
|
||||
* @param id UUID
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param heading 方向角
|
||||
* @param lastLon 上一个点经度
|
||||
* @param lastLat 上一个点纬度
|
||||
* @return 匹配经纬度
|
||||
*/
|
||||
protected double[] getMatchLonLat(String id, double lon, double lat, double heading, double lastLon, double lastLat) {
|
||||
double[] matchedPoint = matchRoad(id, lon,
|
||||
@@ -435,7 +432,7 @@ class BaseDrawer {
|
||||
true
|
||||
);
|
||||
|
||||
boolean match = false;
|
||||
boolean match;
|
||||
if (matchedPoint != null) {
|
||||
// Logger.d( TAG, "matchPoint %s distance = %s",lineCounter, matchedPoint[2] );
|
||||
match = matchedPoint[2] < 1 && matchedPoint[2] > 0;
|
||||
|
||||
@@ -225,8 +225,8 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
/**
|
||||
* todo 后面涉及到此类变化的数据均改动
|
||||
*
|
||||
* @param marker
|
||||
* @param cloudRoadDataProto
|
||||
* @param marker {@link IMogoMarker}
|
||||
* @param cloudRoadDataProto {@link SocketDownData.CloudRoadDataProto}
|
||||
*/
|
||||
private void updateCacheMarkerRes(IMogoMarker marker, SocketDownData.CloudRoadDataProto cloudRoadDataProto) {
|
||||
String resIdVal;
|
||||
@@ -244,7 +244,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
}
|
||||
|
||||
private void removeUselessLastRecord() { // todo 最好重新设计一个数据结构,用于多线程数据过期失效的场景,参见redis数据过期
|
||||
if (mLastPositions == null || mLastPositions.isEmpty()) {
|
||||
if (mLastPositions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
IMogoADASController adasControllerApi = MogoApisHandler.getInstance().getApis().getAdasControllerApi();
|
||||
@@ -305,7 +305,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
builder.setWgslon(matchLonLat[0]);
|
||||
builder.setWgslat(matchLonLat[1]);
|
||||
|
||||
cloudRoadData = builder.build(); //todo 验证值是否改变
|
||||
cloudRoadData = builder.build();
|
||||
|
||||
mLastPositions.put(uniqueKey, cloudRoadData);
|
||||
|
||||
@@ -335,7 +335,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
*/
|
||||
private void prepareData(List<SocketDownData.CloudRoadDataProto> in, List<SocketDownData.CloudRoadDataProto> out) {
|
||||
filterData(in);
|
||||
foreCastPoint(in);
|
||||
// foreCastPoint(in, out);
|
||||
out.addAll(in);
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
*
|
||||
* @param in 数据源
|
||||
*/
|
||||
private void foreCastPoint(List<SocketDownData.CloudRoadDataProto> in) {
|
||||
private void foreCastPoint(List<SocketDownData.CloudRoadDataProto> in, List<SocketDownData.CloudRoadDataProto> out) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
for (SocketDownData.CloudRoadDataProto proto : in) {
|
||||
SocketDownData.CloudRoadDataProto.Builder builder = proto.toBuilder();
|
||||
@@ -378,6 +378,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
long internal = getCurSatelliteTime() - builder.getSatelliteTime();
|
||||
if (internal <= 0) {
|
||||
Log.d(FORECAST, "time internal less than 0 , uuid : " + proto.getUuid());
|
||||
out.add(proto);
|
||||
continue;
|
||||
}
|
||||
long startTime = System.currentTimeMillis();
|
||||
@@ -399,6 +400,8 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
builder.setWgslon(foreCastMogoLatLon.getLon());
|
||||
builder.setSatelliteTime(getCurSatelliteTime() - foreCastInternal);
|
||||
builder.setDistance(distanceFromSelf);
|
||||
proto = builder.build();
|
||||
out.add(proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -502,7 +505,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示用户信息米娜版
|
||||
* 展示用户信息面版
|
||||
*
|
||||
* @param data 道路数据
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user