Merge branch 'lk' into dev2_aiSdk

This commit is contained in:
liujing
2021-04-27 15:03:27 +08:00
2 changed files with 20 additions and 14 deletions

View File

@@ -70,6 +70,12 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
@Override
public void analysisV2XCloundDataEvent(V2XWarningEntity cloundWarningInfo) {
//测试数据
MogoLatLng s = new MogoLatLng(26.88394048,112.5678959);
MogoLatLng t = new MogoLatLng(26.88393912,112.5678793);
Double b = Trigonometric.getAngle(s.lon,s.lat,t.lon,t.lat);
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
mCloundWarningInfo = cloundWarningInfo;
showTime = mCloundWarningInfo.getShowTime();
@@ -100,7 +106,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
//添加停止线marker
handleStopLine();
//自车画线
drawSlefCarLine(carLocation.lon, carLocation.lat, bearing);
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
}, 500);
UiThreadHandler.postDelayed(() -> {
@@ -119,7 +125,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
//车辆静止的时候
drawSlefCarLine(carLocation.lon, carLocation.lat, bearing);
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
}, 500);
@@ -266,7 +272,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
if (mCloundWarningInfo != null) {
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
}
drawSlefCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
}
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
}
@@ -278,7 +284,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
/**
* 自车为起点绘制(根据设计,前方行人/弱势交通参与者预警 getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP自车与停止线之间为蓝色预警;其他侧方预警自车与预碰撞点之间显示红色预警)
*/
private void drawSlefCarLine(double lon, double lat, float bearing) {
private void drawSelfCarLine(double lon, double lat, float bearing) {
if (!isSelfLineClear) {
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
if (mCloundWarningInfo != null) {
@@ -291,9 +297,9 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
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));

View File

@@ -1,22 +1,22 @@
{
"type": 0,
"lat": 26.88008312,
"lon": 112.57147295,
"lat": 26.880223,
"lon": 112.571949,
"distance": 2,
"collisionLat": 26.88008312,
"collisionLon": 112.57147295,
"collisionLat": 26.880238,
"collisionLon": 112.571949,
"stopLines": [
{
"lat": 26.88008312,
"lon": 112.57147295
"lat": 26.880223,
"lon": 112.571949
},
{
"lat": 26.88008302,
"lon": 112.57147295
"lat": 26.880200,
"lon": 112.571949
}
],
"from": 1,
"angle": 0,
"angle": 264,
"direction": 10013,
"speed": 11.108121,
"targetColor": "#FF4040",