[8.0.0][opt]调整预测的数据和绘制逻辑
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
package com.mogo.map.identify;
|
||||
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.identity.IMogoIdentifyManager;
|
||||
import java.util.HashMap;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.yycp.api.proto.SocketDownData;
|
||||
import prediction2025.Prediction2025;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -69,4 +76,40 @@ public class MogoIdentifyManager implements IMogoIdentifyManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePreMarkerPosition(@NonNull HashMap<String, Prediction2025.mPredictionObjectApp> optionsArrayList, @NonNull String mapInstance) {
|
||||
try {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(mapInstance);
|
||||
if(iMogoMap != null){
|
||||
iMogoMap.updatePreMarkerPosition(optionsArrayList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateGps(MogoLocation gnssInfo, @NonNull String mapInstance) {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(mapInstance);
|
||||
if(iMogoMap != null){
|
||||
iMogoMap.getUiController().setExtraGPSData(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUTM(double carX, double carY, double preX, double preY, @NonNull String mapInstance) {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(DEFAULT);// 同一个地图实例保存根据定位计算度带后的值
|
||||
IMogoMap mogoMap2 = MogoMap.Companion.getMapInstance().getMogoMap(mapInstance);
|
||||
if(iMogoMap != null && mogoMap2 != null){
|
||||
double[] arr = iMogoMap.switchData(carX, carY, false);
|
||||
double[] preArr = iMogoMap.switchData(preX, preY, false);
|
||||
if (arr != null && arr.length == 2 && preArr != null && preArr.length == 2) {
|
||||
double angle = DrivingDirectionUtils.getLineAngle(arr[0], arr[1], preArr[0], preArr[1]);
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setHeading(angle);
|
||||
location.setLongitude(arr[0]);
|
||||
location.setLatitude(arr[1]);
|
||||
mogoMap2.getUiController().setExtraGPSData(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user