[V2X]弱势交通参与者下发后没有解析

This commit is contained in:
renwj
2022-10-28 16:00:37 +08:00
parent 30b3432cb1
commit bc87e347d7
3 changed files with 49 additions and 46 deletions

View File

@@ -15,7 +15,6 @@ import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
@@ -65,21 +64,20 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
/**
* 识别物移动
*
* @param data
*/
public void renderWarnData(V2XWarningEntity data) {
public void renderWarnData(double lon, double lat, int type, double collisionlat, double collisionLon, double angle, long showTime) {
MarkerLocation location = new MarkerLocation();
location.setLat(data.getLat());
location.setLon(data.getLon());
location.setLat(lat);
location.setLon(lon);
location.setAngle(angle);
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
marker.addDynamicAnchorPosition(new MogoLatLng(data.getCollisionLat(), data.getCollisionLon()), (float) data.getHeading(), (long) (data.getShowTime() * 1000));
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(type));
// marker.addDynamicAnchorPosition(new MogoLatLng(collisionlat, collisionLon), (float) heading, showTime * 1000);
UiThreadHandler.postDelayed(() -> {
marker.remove();
}, data.getShowTime() * 1000);
}, showTime * 1000);
}
@@ -103,6 +101,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
.data(markerShowEntity)
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon())
.controlAngle(true)
.rotate((float) markerShowEntity.getMarkerLocation().getAngle())
.setGps(true);
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(modeResType)); //TODO
@@ -132,12 +132,11 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
/**
* 绘制停止线 marker
*
* @param data
*/
public void renderStopLineData(V2XWarningEntity data) {
public void renderStopLineData(double lon, double lat) {
MarkerLocation location = new MarkerLocation();
location.setLat(data.getLat());
location.setLon(data.getLon());
location.setLat(lat);
location.setLon(lon);
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);

View File

@@ -37,10 +37,10 @@ public class Trigonometric {
/**
* 根据角度获取指定距离点的经纬度
*/
public static MogoLatLng getNewLocation(MogoLatLng st, double distance, double angle) {
mRadLo = st.getLon() * Math.PI / 180.;
mRadLa = st.getLat() * Math.PI / 180.;
Ec = radius_s + (radius_b - radius_s) * (90. - st.lat) / 90;
public static MogoLatLng getNewLocation(double lon, double lat, double distance, double angle) {
mRadLo = lon * Math.PI / 180.;
mRadLa = lat * Math.PI / 180.;
Ec = radius_s + (radius_b - radius_s) * (90. - lat) / 90;
Ed = Ec * Math.cos(mRadLa);
double dx = distance * Math.sin(Math.toRadians(angle));