diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java index 07dfb1fbb2..85c7794f0e 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java @@ -19,10 +19,15 @@ class DataTypes { public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA"; /** - * 云端下发数据 + * 云端下发警告数据 */ public static final String TYPE_MARKER_CLOUD_WARN_DATA = "TYPE_MARKER_CLOUD_WARN_DATA"; + /** + * 云端下发停止线数据 + */ + public static final String TYPE_MARKER_CLOUD_STOP_LINE_DATA = "TYPE_MARKER_CLOUD_STOP_LINE_DATA"; + /** * Push 事件场景 VR */ diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java index d86d0213d8..0eba5d780f 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java @@ -14,9 +14,9 @@ import com.mogo.module.common.entity.V2XWarningEntity; import com.mogo.service.statusmanager.IMogoStatusChangedListener; import com.mogo.service.statusmanager.StatusDescriptor; import com.mogo.utils.UiThreadHandler; -import com.mogo.utils.WorkThreadHandler; import com.mogo.utils.logger.Logger; +import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; @@ -65,7 +65,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL /** - * 绘制行人和二轮车 + * 绘制行人和二轮车,前方和左右 * * @param data */ @@ -79,7 +79,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA); IMogoMarker marker = drawMarker(markerShowEntity); - Log.d("liyz", "renderWarnData marker != null "); + Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection()); marker.addDynamicAnchorPosition(new MogoLatLng( data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(), data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000); @@ -109,7 +109,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL } /** - * 绘制停止线 + * 绘制停止线 marker * * @param data */ @@ -120,7 +120,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL MarkerShowEntity markerShowEntity = new MarkerShowEntity(); markerShowEntity.setMarkerLocation(location); - markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA); + markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_STOP_LINE_DATA); IMogoMarker marker = drawStopLineMarker(markerShowEntity); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XWaringManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XWaringManager.java index 66bc31e67d..1f736ccfcd 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XWaringManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XWaringManager.java @@ -166,6 +166,7 @@ public class V2XWaringManager { // } ); // //adas自车定位 +// MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient().getLastKnowLocation() // double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon(); // double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat(); } 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 d3499534cb..47d87c5107 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 @@ -108,8 +108,9 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog for (int i = 0; i < fillPoints.size(); i++) { V2XWarningEntity entity = new V2XWarningEntity(); MogoLatLng latLng = (MogoLatLng) fillPoints.get(i); + Log.d("liyz", "handleStopLine lat = " + latLng.lat + "--lon =" + latLng.lon); entity.setLat(latLng.lat); - entity.setLat(latLng.lon); + entity.setLon(latLng.lon); entity.setCollisionLat(mCloundWarningInfo.getCollisionLat()); entity.setCollisionLon(mCloundWarningInfo.getCollisionLon()); entity.heading = mCloundWarningInfo.heading; @@ -194,7 +195,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog public void onCarLocationChanged2(Location latLng) { // Log.d(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear); //当行人经纬度交点 经纬度不为空,开始画线,否则清理 - //自车只需要关注移动 if (!isSelfLineClear) { IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline(); if (mCloundWarningInfo != null) { @@ -258,4 +258,10 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog } + private MogoLatLng getMogoLat(MogoLatLng latlng) { + MogoLatLng newLocation = LocationUtils.getNewLocation(latlng, mCloundWarningInfo.getDistance(), mCloundWarningInfo.getDirection()); + + return newLocation; + } + } 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 a01111e3c1..e6197fd863 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 @@ -20,7 +20,7 @@ "direction": 1, "speed": 11.108121, "targetColor": "#FF4040", - "stopLineDistance": 30, + "stopLineDistance": 15, "warningContent": "小心行人", "heading": 0, "showTime": 3000,