室内环境联调车路云-弱势交通参与者
This commit is contained in:
@@ -68,18 +68,15 @@ public class V2XWarningEntity implements Serializable {
|
|||||||
|
|
||||||
public void setTts(int type) {
|
public void setTts(int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 1:
|
||||||
|
case 11:
|
||||||
this.tts = "注意行人";
|
this.tts = "注意行人";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 2:
|
||||||
this.tts = "注意自行车";
|
this.tts = "注意自行车";
|
||||||
break;
|
break;
|
||||||
case 2:
|
|
||||||
this.tts = "注意摩托车";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
case 4:
|
case 4:
|
||||||
this.tts = "注意前方车辆";
|
this.tts = "注意摩托车";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -213,10 +210,11 @@ public class V2XWarningEntity implements Serializable {
|
|||||||
|
|
||||||
|
|
||||||
public String getTts() {
|
public String getTts() {
|
||||||
if (tts == null) {
|
if (warningContent == null) {
|
||||||
setTts(type);
|
setTts(type);
|
||||||
|
return tts;
|
||||||
}
|
}
|
||||||
return tts;
|
return warningContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getStopLineDistance() {
|
public double getStopLineDistance() {
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ import android.content.Intent;
|
|||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
|
||||||
import com.mogo.module.v2x.V2XConst;
|
import com.mogo.module.v2x.V2XConst;
|
||||||
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
|
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
|
||||||
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
|
|
||||||
import com.mogo.module.v2x.utils.V2XUtils;
|
import com.mogo.module.v2x.utils.V2XUtils;
|
||||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
|
|||||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity);
|
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity);
|
||||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
|
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
|
||||||
mContext.sendBroadcast(intent);
|
|
||||||
} else if (sceneType == 13) {//车路云场景预警-左侧
|
} else if (sceneType == 13) {//车路云场景预警-左侧
|
||||||
V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left");
|
V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left");
|
||||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||||
|
|||||||
@@ -8,30 +8,22 @@ import com.mogo.cloud.commons.utils.CoordinateUtils;
|
|||||||
import com.mogo.map.MogoLatLng;
|
import com.mogo.map.MogoLatLng;
|
||||||
import com.mogo.map.marker.IMogoMarker;
|
import com.mogo.map.marker.IMogoMarker;
|
||||||
import com.mogo.map.marker.MogoMarkerOptions;
|
import com.mogo.map.marker.MogoMarkerOptions;
|
||||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
|
||||||
import com.mogo.map.overlay.IMogoPolyline;
|
import com.mogo.map.overlay.IMogoPolyline;
|
||||||
import com.mogo.module.common.MogoApisHandler;
|
import com.mogo.module.common.MogoApisHandler;
|
||||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||||
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
|
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
|
||||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
|
||||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
|
||||||
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
||||||
import com.mogo.module.common.entity.MarkerLocation;
|
|
||||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
|
||||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||||
import com.mogo.module.common.utils.Trigonometric;
|
import com.mogo.module.common.utils.Trigonometric;
|
||||||
import com.mogo.module.service.MarkerServiceHandler;
|
import com.mogo.module.service.MarkerServiceHandler;
|
||||||
import com.mogo.module.service.receiver.MogoReceiver;
|
import com.mogo.module.service.receiver.MogoReceiver;
|
||||||
import com.mogo.module.v2x.R;
|
|
||||||
import com.mogo.module.v2x.V2XConst;
|
import com.mogo.module.v2x.V2XConst;
|
||||||
import com.mogo.module.v2x.V2XServiceManager;
|
import com.mogo.module.v2x.V2XServiceManager;
|
||||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||||
import com.mogo.module.v2x.listener.V2XLocationListener;
|
import com.mogo.module.v2x.listener.V2XLocationListener;
|
||||||
import com.mogo.module.v2x.marker.OptimalSpeedMarkerView;
|
|
||||||
import com.mogo.module.v2x.marker.V2XFrontTargetMarkerView;
|
import com.mogo.module.v2x.marker.V2XFrontTargetMarkerView;
|
||||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||||
import com.mogo.module.v2x.utils.LocationUtils;
|
|
||||||
import com.mogo.utils.UiThreadHandler;
|
import com.mogo.utils.UiThreadHandler;
|
||||||
import com.mogo.utils.ViewUtils;
|
import com.mogo.utils.ViewUtils;
|
||||||
import com.mogo.utils.WorkThreadHandler;
|
import com.mogo.utils.WorkThreadHandler;
|
||||||
@@ -44,7 +36,6 @@ import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_
|
|||||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
|
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
|
||||||
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP;
|
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP;
|
||||||
import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER;
|
import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER;
|
||||||
import static com.mogo.module.v2x.V2XConst.V2X_OPTIMAL_SPEED_MARKER;
|
|
||||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +84,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
|||||||
isSelfLineClear = false;
|
isSelfLineClear = false;
|
||||||
isFirstLocation = false;
|
isFirstLocation = false;
|
||||||
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
|
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
|
||||||
if (mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) { //前方 TODO
|
if (fillPoints.size() > 0) { //存在停止线的情况 TODO
|
||||||
middleLocationInStopLine = getMiddleLocationInStopLine();
|
middleLocationInStopLine = getMiddleLocationInStopLine();
|
||||||
//如果是正前方类型,红色绘制区域从停止线向前绘制50米
|
//如果是正前方类型,红色绘制区域从停止线向前绘制50米
|
||||||
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, mCloundWarningInfo.getAngle());
|
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, mCloundWarningInfo.getAngle());
|
||||||
@@ -117,15 +108,13 @@ public class V2XWarningMarker implements IV2XMarker {
|
|||||||
isSelfLineClear = true;
|
isSelfLineClear = true;
|
||||||
}, showTime);
|
}, showTime);
|
||||||
|
|
||||||
} else { //左侧或者右侧
|
} else { //无停止线
|
||||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||||
//绘制识别物与交汇点连线,并且更新连线数据
|
//绘制识别物与交汇点连线,并且更新连线数据
|
||||||
drawOtherObjectLine(mCloundWarningInfo);
|
drawOtherObjectLine(mCloundWarningInfo);
|
||||||
//二轮车和行人的渲染和移动
|
//二轮车和行人的渲染和移动
|
||||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||||
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
|
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
|
||||||
//添加停止线marker
|
|
||||||
handleStopLine();
|
|
||||||
//车辆静止的时候
|
//车辆静止的时候
|
||||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||||
|
|
||||||
|
|||||||
@@ -69,13 +69,14 @@ public class V2XWarningWindow extends V2XBasWindow implements IV2XWindow {
|
|||||||
public void show(Object entity) {
|
public void show(Object entity) {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
mV2XWarningEntity = (V2XWarningEntity) entity;
|
mV2XWarningEntity = (V2XWarningEntity) entity;
|
||||||
//行人0/自行车1/摩托车2/小汽车3/公交车4
|
//1行人/2自行车/4摩托车
|
||||||
switch (mV2XWarningEntity.getType()) {
|
switch (mV2XWarningEntity.getType()) {
|
||||||
case 0:
|
case 1:
|
||||||
|
case 11:
|
||||||
typeImage.setImageResource(R.drawable.v2x_road_front_p_warning);
|
typeImage.setImageResource(R.drawable.v2x_road_front_p_warning);
|
||||||
break;
|
break;
|
||||||
case 1:
|
|
||||||
case 2:
|
case 2:
|
||||||
|
case 4:
|
||||||
typeImage.setImageResource(R.drawable.v2x_road_front_m_warning);
|
typeImage.setImageResource(R.drawable.v2x_road_front_m_warning);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
{
|
{
|
||||||
"type": 1,
|
"type": 2,
|
||||||
"lat": 26.879024,
|
"lat": 26.879024,
|
||||||
"lon": 112.568783,
|
"lon": 112.568783,
|
||||||
"distance": 2,
|
"distance": 2,
|
||||||
"collisionLat": 26.8791769,
|
"collisionLat": 26.8791769,
|
||||||
"collisionLon": 112.56896496,
|
"collisionLon": 112.56896496,
|
||||||
"stopLines": [
|
"stopLines": [
|
||||||
{
|
|
||||||
"lat": 26.8791769,
|
|
||||||
"lon": 112.56896496
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lat": 26.879153,
|
|
||||||
"lon": 112.568997
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"from": 1,
|
"from": 1,
|
||||||
"angle": 220,
|
"angle": 220,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"type": 0,
|
"type": 1,
|
||||||
"lat": 26.87912015,
|
"lat": 26.87912015,
|
||||||
"lon": 112.56885373,
|
"lon": 112.56885373,
|
||||||
"distance": 2,
|
"distance": 2,
|
||||||
|
|||||||
@@ -1,20 +1,11 @@
|
|||||||
{
|
{
|
||||||
"type": 2,
|
"type": 4,
|
||||||
"lat": 26.879339,
|
"lat": 26.879339,
|
||||||
"lon": 112.568933,
|
"lon": 112.568933,
|
||||||
"distance": 2,
|
"distance": 2,
|
||||||
"collisionLat": 26.8791769,
|
"collisionLat": 26.8791769,
|
||||||
"collisionLon": 112.56896496,
|
"collisionLon": 112.56896496,
|
||||||
"stopLines": [
|
"stopLines": [
|
||||||
{
|
|
||||||
"lat": 26.8791769,
|
|
||||||
"lon": 112.56896496
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lat": 26.879153,
|
|
||||||
"lon": 112.568997
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"from": 1,
|
"from": 1,
|
||||||
"angle": 260,
|
"angle": 260,
|
||||||
|
|||||||
Reference in New Issue
Block a user