add draw 3dmodel

This commit is contained in:
lixiaopeng
2021-04-01 19:50:09 +08:00
parent 54feb71b4e
commit 618597d2bf
7 changed files with 133 additions and 80 deletions

View File

@@ -86,7 +86,7 @@ public class V2XWaringManager {
// 加载数据源
V2XWarningEntity warningEntity = GsonUtil.objectFromJson(baos.toString(), V2XWarningEntity.class);
V2XServiceManager.getMoGoV2XCloundDataManager().analysisV2XCloundDataEvent(warningEntity);
Logger.d(V2XConst.LOG_NAME_WARN, "testData -----> ");
} catch (Exception e) {
e.printStackTrace();
}
@@ -140,11 +140,14 @@ public class V2XWaringManager {
// info1.setStartLocation(startLatlng1);
// info1.setEndLocation(endLatlng1);
//
// //只有在3d模型下才有值
// //只有在3d模型下高精数据才有值 TODO
// if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
// float roadWidth = V2XServiceManager.getMapUIController().getRoadWidth(116.411198243370,
// 39.9809517154582, (float) 3.13919341919472 , true, true);
// Log.d(V2XConst.LOG_NAME_WARN, "roadWidth = " + roadWidth);
// float pixel = V2XServiceManager.getMapUIController().getScalePerPixel();
// float width = roadWidth / pixel;
// Log.d(V2XConst.LOG_NAME_WARN, "width = " + width + "---pixel = " + pixel);
// info1.setWidth(roadWidth);
// }
//
@@ -156,7 +159,7 @@ public class V2XWaringManager {
// }, 3000 );
// adas 每隔一秒传递的他车或行人数据 TODO
// adas 每隔一秒传递的他车或行人数据
// V2XServiceManager.getmIMogoADASController().addAdasRecognizedDataCallback(resultList -> {
// // 绘制近景识别到的车辆,行人和二轮车
// AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );

View File

@@ -9,7 +9,7 @@ import com.mogo.map.MogoLatLng;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.v2x.MoGoV2XServicePaths;
import com.mogo.module.v2x.V2XConst;
@@ -17,6 +17,7 @@ import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.model.DrawLineInfo;
import com.mogo.module.v2x.manager.IMoGoV2XCloundDataManager;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import java.util.Arrays;
@@ -37,12 +38,11 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
public void analysisV2XCloundDataEvent(V2XWarningEntity cloundWarningInfo) {
mCloundWarningInfo = cloundWarningInfo;
//TODO 根据判断条件,决定是否画线或者删除线
//绘制识别物与交汇点连线,并且更新连线数据 TODO VR模式无法获取道路宽度
// drawOtherObjectLine(cloundWarningInfo);
//二轮车和行人的移动和渲染
SnapshotSetDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
drawOtherObjectLine(cloundWarningInfo);
Logger.d(V2XConst.LOG_NAME_WARN, "analysisV2XCloundDataEvent -----> ");
//二轮车和行人的渲染和移动
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
}
/**
@@ -67,7 +67,9 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
float roadWidth = V2XServiceManager.getMapUIController().getRoadWidth(info.getLon(),
info.getLat(), (float) info.heading, true, true);
Log.d(V2XConst.LOG_NAME_WARN, "roadWidth = " + roadWidth);
lineInfo.setWidth(roadWidth);
float pixel = V2XServiceManager.getMapUIController().getScalePerPixel();
float width = roadWidth / pixel;
lineInfo.setWidth(width);
}
V2XServiceManager.getMoGoPersonWarnPolylineManager().drawPersonWarnPolyline(getContext(), lineInfo);
}
@@ -81,7 +83,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
Log.e(V2XConst.LOG_NAME_WARN, "info == null");
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
}
}
@Override

View File

@@ -23,11 +23,8 @@ public class AdasDataBroadcastReceiver extends BroadcastReceiver {
// Logger.d(V2XConst.LOG_NAME_WARN, "AdasDataBroadcastReceiver -->" + GsonUtil.jsonFromObject(adasResult));
String adasResult = (String) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
Log.d(V2XConst.LOG_NAME_WARN, "AdasDataBroadcastReceiver -----> ");
// V2XWaringManager.getInstance().registerAdasSocketMessage(context);
V2XWaringManager.getInstance().handleAdasData();
} catch (Exception e) {
e.printStackTrace();
}