This commit is contained in:
lixiaopeng
2021-04-08 17:25:42 +08:00
parent 14f3317a4c
commit d0379ca831
5 changed files with 21 additions and 9 deletions

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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;
}
}

View File

@@ -20,7 +20,7 @@
"direction": 1,
"speed": 11.108121,
"targetColor": "#FF4040",
"stopLineDistance": 30,
"stopLineDistance": 15,
"warningContent": "小心行人",
"heading": 0,
"showTime": 3000,