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 0231d8fa6b..01665c64f1 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 @@ -14,7 +14,9 @@ public class V2XWarningEntity implements Serializable { //目标物位置 private double lat; private double lon; - //距离 + //目标物颜色 + public String targetColor; + //目标物距离 private double distance; //预测碰撞点位置 private double collisionLat; @@ -28,9 +30,30 @@ public class V2XWarningEntity implements Serializable { //停止线经纬度 private double stopLineLat; private double stopLineLon; - + //自车到停止线距离 + private double stopLineDistance; + //道路唯一标识 + public String roadId; + //车道唯一标识 + public String laneId; + //识别物体唯一标识 + public String uuid; + //红绿灯颜色 + public String color; + //车ID 暂不使用 + public String carId; //预警文案 - private String tipContent; + private String warningContent; + //车头朝向 + public double heading; + //系统时间 暂时没用 + public long systemTime; + //定位卫星时间 暂时没用 + public long satelliteTime; + //莫顿码 暂时没用 + public long mortonCode; + + //自组字段 //tts播报 private String tts; //打点位置 @@ -54,15 +77,15 @@ public class V2XWarningEntity implements Serializable { public void setTipContent(int type) { switch (type) { case 0: - this.tipContent = "行人碰撞预警"; + this.warningContent = "行人碰撞预警"; break; case 1: case 3: case 4: - this.tipContent = "前车碰撞预警"; + this.warningContent = "前车碰撞预警"; break; case 2: - this.tipContent = "摩托车碰撞预警"; + this.warningContent = "摩托车碰撞预警"; break; default: break; @@ -121,6 +144,10 @@ public class V2XWarningEntity implements Serializable { this.direction = direction; } + public void setTts(String tts) { + this.tts = tts; + } + public void setSpeed(float speed) { this.speed = speed; } @@ -129,7 +156,6 @@ public class V2XWarningEntity implements Serializable { return type; } - public double getLat() { return lat; } @@ -150,7 +176,6 @@ public class V2XWarningEntity implements Serializable { return distance; } - public double getAngle() { return angle; } @@ -163,13 +188,54 @@ public class V2XWarningEntity implements Serializable { return speed; } - public String getTipContent() { - if (this.tipContent == null) { + public String getTargetColor() { + return targetColor; + } + + public String getRoadId() { + return roadId; + } + + public String getLaneId() { + return laneId; + } + + public String getUuid() { + return uuid; + } + + public String getColor() { + return color; + } + + public String getCarId() { + return carId; + } + + public String getWarningContent() { + if (this.warningContent == null) { setTipContent(type); } - return tipContent; + return warningContent; } + public double getHeading() { + return heading; + } + + public long getSystemTime() { + return systemTime; + } + + public long getSatelliteTime() { + return satelliteTime; + } + + public long getMortonCode() { + return mortonCode; + } + + public String getTts() { if (tts == null) { setTts(type); @@ -177,22 +243,6 @@ public class V2XWarningEntity implements Serializable { return tts; } - public void setStopLineLat(double stopLineLat) { - this.stopLineLat = stopLineLat; - } - - public void setStopLineLon(double stopLineLon) { - this.stopLineLon = stopLineLon; - } - - public void setTipContent(String tipContent) { - this.tipContent = tipContent; - } - - public void setTts(String tts) { - this.tts = tts; - } - public double getStopLineLat() { return stopLineLat; } @@ -215,9 +265,18 @@ public class V2XWarningEntity implements Serializable { ", speed=" + speed + ", stopLineLat=" + stopLineLat + ", stopLineLon=" + stopLineLon + - ", tipContent='" + tipContent + '\'' + + ", roadId='" + roadId + '\'' + + ", laneId='" + laneId + '\'' + + ", uuid='" + uuid + '\'' + + ", color='" + color + '\'' + + ", carId='" + carId + '\'' + + ", warningContent='" + warningContent + '\'' + ", tts='" + tts + '\'' + ", location=" + location + + ", heading=" + heading + + ", systemTime=" + systemTime + + ", satelliteTime=" + satelliteTime + + ", mortonCode=" + mortonCode + '}'; } } 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 127f3353a2..f636f2c83f 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 @@ -49,6 +49,7 @@ public class V2XWarningMarker implements IV2XMarker { .longitude(markerShowEntity.getMarkerLocation().getLon()); IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options); options.icon3DRes(com.mogo.module.service.R.raw.people); + options.anchorColor("#DC143C"); IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options); iMarkerView.setMarker(marker); marker.setToTop(); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningWindow.java index 4b609c7777..5e090685fb 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningWindow.java @@ -75,7 +75,7 @@ public class V2XWarningWindow extends V2XBasWindow implements IV2XWindow { break; } distance.setText(String.valueOf(mV2XWarningEntity.getDistance()) + "米"); - warningTextView.setText(mV2XWarningEntity.getTipContent()); + warningTextView.setText(mV2XWarningEntity.getWarningContent()); AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice(mV2XWarningEntity.getTts()); } if (runnableV2XEvent == null) { diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json index 5e70ce79e8..edec36bc85 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json @@ -1,6 +1,5 @@ { "type":0, - "targetType": "1", "lat":39.977121, "lon":116.417537, "distance": 2.22, @@ -9,6 +8,11 @@ "from": 1, "angle": 120, "direction": 10014, - "speed":11.108121 - + "speed":11.108121, + "targetColor": "#D8BFD8", + "stopLineDistance":20, + "stopLineLat": 39.977123, + "stopLineLon": 116.417537, + "warningContent": "小新行人", + "heading": 30 } \ No newline at end of file