删除旧版本的感知数据绘制

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-20 14:56:32 +08:00
parent d803c7897d
commit a8d8e19f67
6 changed files with 73 additions and 175 deletions

View File

@@ -18,9 +18,12 @@ import com.mogo.cloud.socket.entity.SocketDownDataHelper;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.navi.IMogoNaviListener;
@@ -35,12 +38,12 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.status.EnvStatusManager;
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
import com.mogo.service.entrance.ButtonIndex;
import com.mogo.utils.TipToast;
import com.mogo.utils.WorkThreadHandler;
@@ -905,17 +908,26 @@ public class MockIntentHandler implements IntentHandler {
}
}
List<TrafficData> allList = new ArrayList<>();
List<TrafficData> trafficData = new ArrayList<>();
for (BufferedReader reader : readers) {
String line = reader.readLine();
TrafficData adasRecognizedResult = GsonUtil.objectFromJson(line, TrafficData.class);
if (adasRecognizedResult != null) {
allList.add(adasRecognizedResult);
trafficData.add(adasRecognizedResult);
}
}
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(allList);
Log.i("mock-timer-adas", "cost " + (System.currentTimeMillis() - start) + "ms");
try {
if (FunctionBuildConfig.isDrawIdentifyData) {
ThreadUtils.getSinglePool().execute(() ->
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData)
);
} else {
IdentifyDataDrawer.getInstance().clearOldMarker();
}
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
@@ -932,17 +944,26 @@ public class MockIntentHandler implements IntentHandler {
}
}
List<TrafficData> allList = new ArrayList<>();
List<TrafficData> trafficData = new ArrayList<>();
for (BufferedReader reader : readers2) {
String line = reader.readLine();
TrafficData adasRecognizedResult = GsonUtil.objectFromJson(line, TrafficData.class);
if (adasRecognizedResult != null) {
allList.add(adasRecognizedResult);
trafficData.add(adasRecognizedResult);
}
}
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(allList);
Log.i("mock-timer-adas", "cost " + (System.currentTimeMillis() - start) + "ms");
try {
if (FunctionBuildConfig.isDrawIdentifyData) {
ThreadUtils.getSinglePool().execute(() ->
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData)
);
} else {
IdentifyDataDrawer.getInstance().clearOldMarker();
}
} catch (Exception e) {
e.printStackTrace();
}
return true;
}

View File

@@ -173,32 +173,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
DebugConfig.setStatus(DebugConfig.sDownloadLink, false);
}
});
// adas 每隔一定频率传递过来的数据
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback(resultList -> {
// Message msg = mSnapshotHandler.obtainMessage();
// msg.obj = resultList;
// msg.what = MSG_ADAS;
// msg.sendToTarget();
// 使用与渠道配置一样的gps提供者提供的数据 修改fPadLenovo.gradle文件中的GPS_PROVIDER字段控制渲染来源
Logger.d(TAG, "result.addAdasRecognizedDataCallback == 3 ------> ");
if (FunctionBuildConfig.isDrawIdentifyData) {
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(resultList);
}
//添加自车的定位图标,碰撞只有一个预警,还需要和adas 联调,
// for ( ADASRecognizedResult result : resultList) {
// if (result.drawlevel == 3) { //找出可能碰撞的车
// Logger.d("liyz", "result.drawlevel == 3 ------> ");
//// 绘制他车的线,从列表中查出可能碰撞的车的经纬度(没有或者只有一个)然后预设20米的长度
//// 绘制碰撞的他车指引线,需要实时给数据更新 TODO
// drawLimberCollisionPolyline(result);
// //通过这个传值到 AMapViewWrapper根据数据更新自车的模型数据
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result.drawlevel);
// }
// }
});
}