diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 4ff10f68a5..83405b8de1 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -91,7 +91,6 @@
-
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java
index 532dca9d7a..b4a0bd6382 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java
@@ -126,6 +126,14 @@ public class V2XWarningEntity implements Serializable {
this.speed = speed;
}
+ public long getShowTime() {
+ return showTime;
+ }
+
+ public void setShowTime(long showTime) {
+ this.showTime = showTime;
+ }
+
public void setStopLineDistance(double stopLineDistance) {
this.stopLineDistance = stopLineDistance;
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java
index e9b15b4f78..f5d8fe193e 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java
@@ -34,6 +34,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER;
import static com.mogo.module.v2x.V2XServiceManager.getContext;
@@ -47,7 +48,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
private boolean isSelfLineClear;
private List fillPoints = new ArrayList();//停止线经纬度合集
-
@Override
public void init(Context context) {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
@@ -69,7 +69,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
Log.d(V2XConst.LOG_NAME_WARN, "direction = " + cloundWarningInfo.getDirection());
if (cloundWarningInfo.getDirection() == 1) { //前方
//停止线前方画线
- MogoLatLng newLocation = LocationUtils.getNewLocation((MogoLatLng) fillPoints.get(0), 80, cloundWarningInfo.heading);
+ MogoLatLng newLocation = LocationUtils.getNewLocation((MogoLatLng) fillPoints.get(0), 80, cloundWarningInfo.getAngle());
WorkThreadHandler.getInstance().postDelayed(() -> {
//二轮车和行人的渲染和移动
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
@@ -83,7 +83,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
V2XServiceManager.getMoGoStopPolylineManager().clearLine();
-
isSelfLineClear = true;
}, 8000);
@@ -125,15 +124,19 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
* 2D资源绘制停止线
* */
private void drawStopLineWith2Resource() {
- mCloundWarningInfo.setCarLocation(new MogoLatLng(39.976866,116.417622));//测试数据
+
+ //自车位置39.97665425796924--116.41769983329762
+ mCloundWarningInfo.setCarLocation(new MogoLatLng(39.97665425796924,116.41769983329762));//测试数据
+
MogoLatLng carlo = mCloundWarningInfo.getCarLocation();
- if (carlo == null){
+ if (carlo == null) {
double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
carlo = new MogoLatLng(lat, lon);
}
+ //自车行驶方向的前方*米的经纬度,该经纬度在停止线上
MogoLatLng drawStopLineLon = LocationUtils.getNewLocation(carlo, mCloundWarningInfo.getStopLineDistance(), mCloundWarningInfo.getAngle());
-
+ Log.d(TAG, "2D资源绘制停止线"+drawStopLineLon);
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
.latitude(drawStopLineLon.getLat())
.longitude(drawStopLineLon.getLon())
@@ -142,9 +145,12 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
optionsRipple
.icon(ViewUtils.fromView(new EmptyMarkerView(V2XServiceManager.getContext())));
- IMogoMarker stopLine = V2XServiceManager.getMarkerManager().addMarker(V2X_FRONT_WARNING_MARKER, optionsRipple);
+ IMogoMarker stopLine = V2XServiceManager.getMarkerManager().addMarker(TYPE_MARKER_CLOUD_STOP_LINE_DATA, optionsRipple);
stopLine.setInfoWindowAdapter(new SimpleWindow3DAdapter(new V2XFrontTargetMarkerView(V2XServiceManager.getContext())));
stopLine.showInfoWindow();
+// UiThreadHandler.postDelayed(() -> {
+// stopLine.hideInfoWindow();
+// }, 8000);
}
/**
@@ -224,6 +230,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
public void onCarLocationChanged2(Location latLng) {
Log.e(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear);
//当行人经纬度交点 开始画线,否则清理
+ mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
drawSlefCarLine(latLng);
}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java
index 2b44bef806..6470241db7 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java
@@ -60,13 +60,10 @@ public class V2XWarningMarker implements IV2XMarker {
.longitude(mMarkerEntity.getLon())
.anchor(0.5f, 0.5f)
.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
-
- if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
- }
optionsRipple
- .icon(ViewUtils.fromView(new EmptyMarkerView(V2XServiceManager.getContext())));
+ .icon(ViewUtils.fromView(new EmptyMarkerView(mContext)));
optimalMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_FRONT_WARNING_MARKER, optionsRipple);
- optimalMarker.setInfoWindowAdapter(new SimpleWindow3DAdapter(new V2XFrontTargetMarkerView(V2XServiceManager.getContext())));
+ optimalMarker.setInfoWindowAdapter(new SimpleWindow3DAdapter(new V2XFrontTargetMarkerView(mContext)));
optimalMarker.showInfoWindow();
} catch (Exception e) {
@@ -76,21 +73,6 @@ public class V2XWarningMarker implements IV2XMarker {
}
- private void drawMarkerWithLocation(MogoLatLng latLng, String tag) {
- MogoMarkerOptions options = new MogoMarkerOptions()
- .object(markerShowEntity)
- .latitude(latLng.lat)
- .longitude(latLng.lon);
- IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
- options.icon3DRes(com.mogo.module.service.R.raw.people);
- options.anchor(0.5f, 0.5f);
- options.anchorColor("#FF4040");
- IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(tag, options);
- iMarkerView.setMarker(marker);
- marker.setToTop();
- }
-
-
@Override
public void clearPOI() {
V2XServiceManager.getMarkerManager().removeMarkers(V2X_FRONT_WARNING_MARKER);
diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_warning_marker_target.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_warning_marker_target.png
deleted file mode 100644
index be6da047d0..0000000000
Binary files a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_warning_marker_target.png and /dev/null differ