车路云预警-左侧模拟数据添加:
指引箭头位置与划线位置不符,需要找地图侧联调,person模型未打点成功,已同步地图侧
This commit is contained in:
@@ -71,66 +71,66 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
@Override
|
||||
public void analysisV2XCloundDataEvent(V2XWarningEntity cloundWarningInfo) {
|
||||
// if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
mCloundWarningInfo = cloundWarningInfo;
|
||||
showTime = mCloundWarningInfo.getShowTime();
|
||||
pointsBetween();
|
||||
bearing = V2XLocationListener.getInstance().getLastCarLocation().getBearing();
|
||||
mCloundWarningInfo = cloundWarningInfo;
|
||||
showTime = mCloundWarningInfo.getShowTime();
|
||||
pointsBetween();
|
||||
bearing = V2XLocationListener.getInstance().getLastCarLocation().getBearing();
|
||||
|
||||
//顶部弹框
|
||||
if (mV2XScenario == null) {
|
||||
mV2XScenario = new V2XFrontWarningScenario();
|
||||
}
|
||||
mV2XScenario.setWarningEntity(cloundWarningInfo);
|
||||
mV2XScenario.init(null);
|
||||
//预警蒙层
|
||||
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
|
||||
isSelfLineClear = false;
|
||||
isFirstLocation = false;
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
|
||||
if (cloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) { //前方 TODO
|
||||
middleLocationInStopLine = getMiddleLocationInStopLine();
|
||||
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, cloundWarningInfo.getAngle());
|
||||
//停止线前方画线
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawRedWarningLineFrontOfStopLine(cloundWarningInfo, middleLocationInStopLine, warningLocation);
|
||||
//添加停止线marker
|
||||
handleStopLine();
|
||||
//自车画线
|
||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
}, 500);
|
||||
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoStopPolylineManager().clearLine();
|
||||
isSelfLineClear = true;
|
||||
}, showTime);
|
||||
|
||||
} else { //左侧或者右侧
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
|
||||
//车辆静止的时候
|
||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
|
||||
}, 500);
|
||||
|
||||
//延迟3秒清理线
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
isSelfLineClear = true;
|
||||
}, showTime);
|
||||
}
|
||||
//顶部弹框
|
||||
if (mV2XScenario == null) {
|
||||
mV2XScenario = new V2XFrontWarningScenario();
|
||||
}
|
||||
mV2XScenario.setWarningEntity(cloundWarningInfo);
|
||||
mV2XScenario.init(null);
|
||||
//预警蒙层
|
||||
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
|
||||
isSelfLineClear = false;
|
||||
isFirstLocation = false;
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
|
||||
if (cloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) { //前方 TODO
|
||||
middleLocationInStopLine = getMiddleLocationInStopLine();
|
||||
MogoLatLng warningLocation = new MogoLatLng(cloundWarningInfo.getLat(),cloundWarningInfo.getLon());
|
||||
//停止线前方画线
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawRedWarningLineFrontOfStopLine(cloundWarningInfo, middleLocationInStopLine, warningLocation);
|
||||
//添加停止线marker
|
||||
handleStopLine();
|
||||
//自车画线
|
||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
}, 500);
|
||||
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoStopPolylineManager().clearLine();
|
||||
isSelfLineClear = true;
|
||||
}, showTime);
|
||||
|
||||
} else { //左侧或者右侧
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
|
||||
//车辆静止的时候
|
||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
|
||||
}, 500);
|
||||
|
||||
//延迟3秒清理线
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
isSelfLineClear = true;
|
||||
}, showTime);
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
@@ -149,12 +149,13 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
carLocation = getMogoLat(new MogoLatLng(lat, lon));
|
||||
isFirstLocation = true;
|
||||
}
|
||||
|
||||
//绘制线的终点(在停止线上或者预碰撞点上)
|
||||
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lat : mCloundWarningInfo.getCollisionLat(),
|
||||
mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lon : mCloundWarningInfo.getCollisionLon());
|
||||
//自车位置
|
||||
startLatlng = new MogoLatLng(lat, lon);
|
||||
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
|
||||
//扩展点为了渐变色添加
|
||||
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2, Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
|
||||
Log.d(TAG, "自车为起点绘制 自车;" + startLatlng.lat + "," + startLatlng.lon +
|
||||
"中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
|
||||
@@ -193,8 +194,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
|
||||
entity.setLat(latLng.lat);
|
||||
entity.setLon(latLng.lon);
|
||||
entity.setCollisionLat(mCloundWarningInfo.getCollisionLat());
|
||||
entity.setCollisionLon(mCloundWarningInfo.getCollisionLon());
|
||||
entity.heading = mCloundWarningInfo.heading;
|
||||
V2XWarnDataDrawer.getInstance().renderStopLineData(entity);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"type": 1,
|
||||
"lat": 26.879390180525974,
|
||||
"lon": 112.56927332599024,
|
||||
"lat": 26.8826301,
|
||||
"lon": 112.5634948,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.879413602631494,
|
||||
"collisionLon": 112.56942224899758,
|
||||
"collisionLat": 26.88271105,
|
||||
"collisionLon": 112.5636347,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88008312,
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"type": 2,
|
||||
"lat": 26.879413602631494,
|
||||
"lon": 112.56942224899758,
|
||||
"lat": 26.88241239,
|
||||
"lon": 112.5631241,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.879393211872856,
|
||||
"collisionLon": 112.56917110603266,
|
||||
"collisionLat": 26.88241239,
|
||||
"collisionLon": 112.5631241,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88008312,
|
||||
"lon": 112.57147295
|
||||
"lat": 26.88241239,
|
||||
"lon": 112.5631241
|
||||
},
|
||||
{
|
||||
"lat": 26.88008302,
|
||||
"lon": 112.57147295
|
||||
"lat": 26.88241239,
|
||||
"lon": 112.5631241
|
||||
}
|
||||
],
|
||||
"from": 1,
|
||||
|
||||
Reference in New Issue
Block a user