vr版本;侧方预警画线经纬度补点修改

This commit is contained in:
liujing
2021-04-15 20:17:16 +08:00
parent 1b1c70a6a1
commit 40f640a2c7
7 changed files with 12 additions and 10 deletions

View File

@@ -256,7 +256,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
}
/**
* 绘制安全区域,自车与碰撞点之间的蓝色线
* 自车为起点绘制(根据设计,前方行人/弱势交通参与者预警 getDirection() == 1 自车与停止线之间为蓝色预警;其他侧方预警自车与预碰撞点之间显示红色预警)
*/
private void drawSlefCarLine(double lon, double lat, float bearing) {
if (!isSelfLineClear) {
@@ -266,13 +266,16 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
MogoLatLng endLatlng = null;
MogoLatLng addMiddleLoc = null;
if (!isFirstLocation) {
//自车位置
startLatlng = new MogoLatLng(lat, lon);
carLocation = getMogoLat(new MogoLatLng(lat, lon));
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == 1 ? carLocation.lat : mCloundWarningInfo.getCollisionLat(),
mCloundWarningInfo.getDirection() == 1 ? carLocation.lon : mCloundWarningInfo.getCollisionLon());
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == 1 ? middleLocationInStopLine.lat : mCloundWarningInfo.getCollisionLat(),
mCloundWarningInfo.getDirection() == 1 ? middleLocationInStopLine.lon : mCloundWarningInfo.getCollisionLon());
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
Log.d(V2XConst.LOG_NAME_WARN, "drawSlefCarLine lon = " + carLocation.lon + "---lat = " + carLocation.lat);
Log.d(TAG, "已自车为起点绘制 自车;" + startLatlng.lat + "," + startLatlng.lon +
"中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
isFirstLocation = true;
}
if (mogoPolyline != null) {