室内环境联调车路云-弱势交通参与者

This commit is contained in:
liujing
2021-06-01 18:23:05 +08:00
parent 3689f673fb
commit fd42ba2b2d
8 changed files with 16 additions and 48 deletions

View File

@@ -5,10 +5,8 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
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.entity.net.V2XOptimalRouteDataRes;
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;

View File

@@ -139,7 +139,6 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
mContext.sendBroadcast(intent);
} else if (sceneType == 13) {//车路云场景预警-左侧
V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left");
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);

View File

@@ -8,30 +8,22 @@ import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.MarkerDrawer;
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
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.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.common.utils.Trigonometric;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.model.DrawLineInfo;
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.scenario.view.IV2XMarker;
import com.mogo.module.v2x.utils.LocationUtils;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.ViewUtils;
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.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_OPTIMAL_SPEED_MARKER;
import static com.mogo.module.v2x.V2XServiceManager.getContext;
/**
@@ -93,7 +84,7 @@ public class V2XWarningMarker implements IV2XMarker {
isSelfLineClear = false;
isFirstLocation = false;
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
if (mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) { //前方 TODO
if (fillPoints.size() > 0) { //存在停止线的情况 TODO
middleLocationInStopLine = getMiddleLocationInStopLine();
//如果是正前方类型,红色绘制区域从停止线向前绘制50米
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, mCloundWarningInfo.getAngle());
@@ -117,15 +108,13 @@ public class V2XWarningMarker implements IV2XMarker {
isSelfLineClear = true;
}, showTime);
} else { //左侧或者右侧
} else { //无停止线
WorkThreadHandler.getInstance().postDelayed(() -> {
//绘制识别物与交汇点连线,并且更新连线数据
drawOtherObjectLine(mCloundWarningInfo);
//二轮车和行人的渲染和移动
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
//添加停止线marker
handleStopLine();
//车辆静止的时候
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);

View File

@@ -69,13 +69,14 @@ public class V2XWarningWindow extends V2XBasWindow implements IV2XWindow {
public void show(Object entity) {
if (entity != null) {
mV2XWarningEntity = (V2XWarningEntity) entity;
//行人0/自行车1/摩托车2/小汽车3/公交车4
//1行人/2自行车/4摩托车
switch (mV2XWarningEntity.getType()) {
case 0:
case 1:
case 11:
typeImage.setImageResource(R.drawable.v2x_road_front_p_warning);
break;
case 1:
case 2:
case 4:
typeImage.setImageResource(R.drawable.v2x_road_front_m_warning);
break;
default: