note the matchRoad and new thead of handle to deal with addDynamicAnchorPosition
This commit is contained in:
@@ -215,16 +215,16 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
final long start = System.currentTimeMillis();
|
||||
Log.d("EmArrow", "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type);
|
||||
ADASRecognizedResult lastPosition = mLastPositions.remove(uniqueKey); //todo 缓存数据太多
|
||||
double lastLon = -1;
|
||||
double lastLat = -1;
|
||||
if (lastPosition != null) {
|
||||
lastLon = lastPosition.lon;
|
||||
lastLat = lastPosition.lat;
|
||||
}
|
||||
double[] matchLonLat = getMatchLonLat(recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat);
|
||||
|
||||
recognizedListResult.lon = matchLonLat[0];
|
||||
recognizedListResult.lat = matchLonLat[1];
|
||||
// double lastLon = -1;
|
||||
// double lastLat = -1;
|
||||
// if (lastPosition != null) {
|
||||
// lastLon = lastPosition.lon;
|
||||
// lastLat = lastPosition.lat;
|
||||
// }
|
||||
// double[] matchLonLat = getMatchLonLat(recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat);
|
||||
//
|
||||
// recognizedListResult.lon = matchLonLat[0];
|
||||
// recognizedListResult.lat = matchLonLat[1];
|
||||
|
||||
mLastPositions.put(uniqueKey, recognizedListResult);
|
||||
// Log.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
|
||||
@@ -235,9 +235,9 @@ 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);
|
||||
});
|
||||
// SimpleHandlerThreadPool.getInstance().postRender(() -> {
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.heading, intervalRef);
|
||||
// });
|
||||
} else {
|
||||
marker.setRotateAngle(((float) recognizedListResult.heading));
|
||||
marker.setPosition(recognizedListResult.lat, recognizedListResult.lon);
|
||||
|
||||
Reference in New Issue
Block a user