Merge branch 'master' into dev_robouiadapter_1062_221117_1.6.2
# Conflicts: # OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_route_fragment.xml # OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/video/VideoActivity.kt # OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_passenger_check_panel.xml # OCH/mogo-och-taxi/src/main/res/layout/taxi_being_order.xml # OCH/mogo-och-taxi/src/main/res/layout/taxi_navi_view.xml # app/src/main/java/com/mogo/launcher/MogoApplication.java # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt # core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml # core/function-impl/mogo-core-function-hmi/src/main/res/values-xhdpi-2560x1440/color.xml # gradle.properties
This commit is contained in:
@@ -329,69 +329,42 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
|
||||
private fun refreshCarState(location: MogoLocation) {
|
||||
V2XStatusManager.getInstance().location = location
|
||||
// V2XAiRoadEventMarker.onLocationChanged(location)
|
||||
// 只有车速大于 5 的时候进行计算
|
||||
if (location.speed < 5) return
|
||||
val v2xPolyline = BridgeApi.v2xPolyline()?.mogoPolyline
|
||||
val isRoadEventPOIShow = BridgeApi.v2xStatus()?.isRoadEventPOIShow ?: false
|
||||
val isOtherSeekHelpPOIShow = BridgeApi.v2xStatus()?.isOtherSeekHelpPOIShow ?: false
|
||||
val v2xStatusManager = V2XStatusManager.getInstance()
|
||||
if (v2xPolyline != null && (isRoadEventPOIShow or isOtherSeekHelpPOIShow) && v2xStatusManager.targetMoGoLatLng != null) { // 取出原有的绘制线的经纬度点
|
||||
if (v2xPolyline != null && (isRoadEventPOIShow) && v2xStatusManager.targetMoGoLatLng != null) { // 取出原有的绘制线的经纬度点
|
||||
// 取出原有的绘制线的经纬度点
|
||||
val pointsOdl: MutableList<MogoLatLng> = v2xPolyline.points // 重新设置第一个坐标,也就是当前车辆位置
|
||||
// 重新设置第一个坐标,也就是当前车辆位置
|
||||
pointsOdl[0] = MogoLatLng(location.latitude, location.longitude)
|
||||
v2xPolyline.points = pointsOdl
|
||||
|
||||
//CallerLogger.d("$M_V2X$TAG", "当前地图的缩放比例为:" + zoomLevel);
|
||||
val zoomLevel: Float = CallerMapUIServiceManager.getMapUIController()?.zoomLevel ?: 0.0f
|
||||
//CallerLogger.d("$M_V2X$TAG", "当前地图的缩放比例为:" + zoomLevel);
|
||||
if (zoomLevel > 0 && zoomLevel <= 17 && BridgeApi.v2xStatus()?.isRoadEventWindowShow == false) { // 缩放地图
|
||||
if (zoomLevel > 0 && zoomLevel <= 17) { // 缩放地图
|
||||
val context: Context = context()
|
||||
MapUtils.zoomMap(v2xStatusManager.targetMoGoLatLng, context)
|
||||
}
|
||||
}
|
||||
|
||||
// if (DebugConfig.isMapBased()) { // 只有自研车机才有疲劳驾驶检测
|
||||
// // 只有自研车机才有疲劳驾驶检测
|
||||
// if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
|
||||
// V2XAlarmServer.getFatigueDrivingShow(location) { drivingShowEntity ->
|
||||
// CallerLogger.i("$M_V2X$TAG", "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity))
|
||||
// val style = if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) "1" else "2"
|
||||
// com.mogo.module.v2x.listener.V2XLocationListener.trackWithType(ALERT_FATIGUE_DRIVING.poiType, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style)
|
||||
// val v2XMessageEntity = V2XMessageEntity<V2XPushMessageEntity>()
|
||||
// v2XMessageEntity.type = V2XTypeEnum.ALERT_FATIGUE_DRIVING
|
||||
// v2XMessageEntity.setContent(drivingShowEntity)
|
||||
// v2XMessageEntity.isShowState = drivingShowEntity.isShowWindow() // 广播给ADAS Launcher
|
||||
// ADASUtils.broadcastToADAS(context(), drivingShowEntity)
|
||||
// V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 巡航处理
|
||||
val v2XRoadEventEntity = V2XAlarmServer.getDriveFrontAlarmEvent(
|
||||
BridgeApi.v2xMarker()?.v2XRoadEventEntityList,
|
||||
V2XStatusManager.getInstance().location
|
||||
) // 距离是否大于10米 && 消息是否不为空
|
||||
// 距离是否大于10米 && 消息是否不为空
|
||||
if (v2XRoadEventEntity != null && v2XRoadEventEntity.distance >= 5) { // CallerLogger.w("$M_V2X$TAG",
|
||||
// //"\nV2X预警--当前导航状态:" + V2XServiceManager.getNavi().isNaviing() +
|
||||
// //"\nV2X预警--roadEventIsNullCount:" + roadEventIsNullCount +
|
||||
// "\nV2X预警--当前预警事件:" + v2XRoadEventEntity
|
||||
// );
|
||||
// CallerLogger.w("$M_V2X$TAG", "V2X预警--前方数据距离:" + v2XRoadEventEntity.getDistance());
|
||||
// 触发展示操作
|
||||
TrackUtils.trackV2xRoadProduceEvent(1)
|
||||
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
|
||||
v2XMessageEntity.type = V2XTypeEnum.ALERT_ROAD_WARNING
|
||||
v2XMessageEntity.content = v2XRoadEventEntity
|
||||
v2XMessageEntity.isShowState = true
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
|
||||
// 存储本地,出行动态作展示
|
||||
saveLocalStory(V2XTypeEnum.ALERT_ROAD_WARNING, v2XRoadEventEntity.noveltyInfo)
|
||||
|
||||
)
|
||||
if (v2XRoadEventEntity != null) { // CallerLogger.w("$M_V2X$TAG",
|
||||
val distance = v2XRoadEventEntity.distance
|
||||
val min = if (EventTypeEnum.AI_ROAD_WORK.poiType == v2XRoadEventEntity.poiType) 0 else 5
|
||||
Logger.d(TAG, "--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}")
|
||||
if (distance >= min) {
|
||||
Logger.d(TAG, "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType)
|
||||
TrackUtils.trackV2xRoadProduceEvent(1)
|
||||
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
|
||||
v2XMessageEntity.type = V2XTypeEnum.ALERT_ROAD_WARNING
|
||||
v2XMessageEntity.content = v2XRoadEventEntity
|
||||
v2XMessageEntity.isShowState = true
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,11 +480,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
|
||||
private fun handleRoadMarkerEvent(data: V2XMarkerCardResult) {
|
||||
try {
|
||||
BridgeApi.v2xStatus()?.let {
|
||||
if (it.isRoadEventWindowShow) {
|
||||
return
|
||||
}
|
||||
}
|
||||
scope.launch(Dispatchers.Default) {
|
||||
BridgeApi.v2xMarker()?.analysisV2XRoadEvent(data)
|
||||
}
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.alarm;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.DrivingDirectionUtils;
|
||||
import com.mogo.eagle.core.utilcode.constant.TimeConstants;
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import io.netty.util.internal.ConcurrentSet;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
@@ -29,11 +24,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
public class V2XAlarmServer {
|
||||
|
||||
// 记录道路播报的事件
|
||||
public static ConcurrentHashMap<V2XRoadEventEntity, String> mAlertRoadEventList = new ConcurrentHashMap<>();
|
||||
|
||||
// 记录违章停车播报事件
|
||||
private static final HashMap<MarkerExploreWay, String> mAlertIllegalParkEventList = new HashMap<>();
|
||||
|
||||
private static ConcurrentSet<V2XRoadEventEntity> showedEvents = new ConcurrentSet<>();
|
||||
/**
|
||||
* 获取当前车辆前方距离最近的道路事件
|
||||
*/
|
||||
@@ -41,9 +32,22 @@ public class V2XAlarmServer {
|
||||
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
||||
MogoLocation currentLocation) {
|
||||
try {
|
||||
// 检测道路事件是否需UGC问答
|
||||
V2XEarlyWarningServer.roadEventUgcCheck(currentLocation);
|
||||
// 60(km/h)
|
||||
if (!showedEvents.isEmpty()) {
|
||||
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
V2XRoadEventEntity next = iterator.next();
|
||||
if (next == null) {
|
||||
continue;
|
||||
}
|
||||
MarkerLocation poiLocation = next.getLocation();
|
||||
if (poiLocation == null) {
|
||||
continue;
|
||||
}
|
||||
if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getBearing())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
||||
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
||||
@@ -73,71 +77,14 @@ public class V2XAlarmServer {
|
||||
(int) currentLocation.getBearing()
|
||||
);
|
||||
if (0 <= eventAngle && eventAngle <= 20) {
|
||||
// 判断是否已经提示过道路事件
|
||||
boolean isAlreadyAlert = false;
|
||||
String lastTime = mAlertRoadEventList.get(v2XRoadEventEntity);
|
||||
if (!TextUtils.isEmpty(lastTime)) {
|
||||
long timeSpan = Math.abs(TimeUtils.getTimeSpanByNow(lastTime, TimeConstants.MIN));
|
||||
// CallerLogger.INSTANCE.w(M_V2X + "V2XAlarmServer",
|
||||
// "V2X预警--事件ID:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
|
||||
// "\n上一次预警时间:" + lastTime +
|
||||
// "\n距离当前时间:" + timeSpan);
|
||||
// 5分钟内不重复提醒
|
||||
if (timeSpan < 5) {
|
||||
isAlreadyAlert = true;
|
||||
}
|
||||
if (showedEvents.contains(v2XRoadEventEntity)) {
|
||||
return null;
|
||||
}
|
||||
// 进行提醒
|
||||
if (!isAlreadyAlert) {
|
||||
// CallerLogger.INSTANCE.w(M_V2X + "V2XAlarmServer", "V2X预警--车辆与事件信息:" +
|
||||
// "\n事件详情ID:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
|
||||
// "\n事件详情:" + GsonUtil.jsonFromObject(v2XRoadEventEntity.getNoveltyInfo()) +
|
||||
// "\n距离:" + v2XRoadEventEntity.getDistance() + "米" +
|
||||
// "\n是否已经提醒:" + isAlreadyAlert +
|
||||
// "\n当前车辆-经度:" + currentLocation.getLongitude() +
|
||||
// "\n当前车辆-经度:" + currentLocation.getLatitude() +
|
||||
// "\n当前车辆-角度:" + currentLocation.getBearing() +
|
||||
// "\n道路事件-经度:" + eventLocation.getLon() +
|
||||
// "\n道路事件-经度:" + eventLocation.getLat() +
|
||||
// "\n道路事件-角度:" + eventLocation.getAngle() +
|
||||
// "\n夹角角度:" + eventAngle + " 度"
|
||||
// );
|
||||
mAlertRoadEventList.put(v2XRoadEventEntity, TimeUtils.getNowString());
|
||||
return v2XRoadEventEntity;
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
// CallerLogger.INSTANCE.w(M_V2X + "V2XAlarmServer", "V2X预警--事件与车头角度夹角过大:" +
|
||||
// "\n事件详情:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
|
||||
// "\n当前车辆-经度:" + currentLocation.getLongitude() +
|
||||
// "\n当前车辆-经度:" + currentLocation.getLatitude() +
|
||||
// "\n当前车辆-角度:" + currentLocation.getBearing() +
|
||||
// "\n道路事件-经度:" + eventLocation.getLon() +
|
||||
// "\n道路事件-经度:" + eventLocation.getLat() +
|
||||
// "\n道路事件-角度:" + eventLocation.getAngle() +
|
||||
// "\n夹角角度:" + eventAngle + " 度"
|
||||
// );
|
||||
showedEvents.add(v2XRoadEventEntity);
|
||||
return v2XRoadEventEntity;
|
||||
}
|
||||
} else {
|
||||
// CallerLogger.INSTANCE.w(M_V2X + "V2XAlarmServer",
|
||||
// "V2X预警--车头方向与事件方向角度不一致:" +
|
||||
// "\n事件详情:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
|
||||
// "\n车头方向: " + carBearing +
|
||||
// "\n事件方向:" + eventBearing +
|
||||
// "\n角度差值:" + diffAngle
|
||||
// );
|
||||
}
|
||||
} else {
|
||||
// CallerLogger.INSTANCE.w(M_V2X + "V2XAlarmServer", "V2X预警--车辆距离事件距离大于500米了:" +
|
||||
// "\n事件详情:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
|
||||
// "\n距离:" + v2XRoadEventEntity.getDistance() + "米"
|
||||
// );
|
||||
}
|
||||
} else {
|
||||
// CallerLogger.INSTANCE.e(M_V2X + "V2XAlarmServer",
|
||||
// "V2X预警--道路事件没有角度信息" +
|
||||
// "\n事件详情:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId()
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,4 +94,14 @@ public class V2XAlarmServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isOutOfRange(double poi_lon, double poi_lat, double car_lon, double car_lat, double car_angle) {
|
||||
return !isFrontOfCar(poi_lon, poi_lat, car_lon, car_lat, car_angle);
|
||||
}
|
||||
|
||||
private static boolean isFrontOfCar(double poi_lon, double poi_lat, double car_lon, double car_lat, double car_angle) {
|
||||
double degree = DrivingDirectionUtils.getDegreeOfCar2Poi(car_lon, car_lat, poi_lon, poi_lat, (int)car_angle);
|
||||
return degree <= 90;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.alarm;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.DrivingDirectionUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* V2X 道路预警服务
|
||||
*/
|
||||
public class V2XEarlyWarningServer {
|
||||
private static final String TAG = "V2XEarlyWarningServer";
|
||||
|
||||
private static ArrayList<String> alertMessageId = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 对提醒过的道路事件进行UGC检测
|
||||
*
|
||||
* @param currentLocation 当前车辆位置
|
||||
*/
|
||||
public static void roadEventUgcCheck(MogoLocation currentLocation) {
|
||||
|
||||
try {
|
||||
if (currentLocation != null) {
|
||||
// 循环已经播报的道路事件,将刚行驶过的道路事件进行弹窗交互,进行UGC问答,
|
||||
Set<V2XRoadEventEntity> keySet = V2XAlarmServer.mAlertRoadEventList.keySet();
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : keySet) {
|
||||
// 计算车辆距离指定气泡的距离
|
||||
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
||||
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
currentLocation.getLongitude(),
|
||||
currentLocation.getLatitude(),
|
||||
eventLocation.getLon(),
|
||||
eventLocation.getLat(),
|
||||
(int) currentLocation.getBearing()
|
||||
);
|
||||
|
||||
double carBearing = currentLocation.getBearing();
|
||||
String roadInfoId = v2XRoadEventEntity.getNoveltyInfo().getInfoId();
|
||||
|
||||
// 封路、施工、拥堵、拥堵 才会有UGC提示
|
||||
if (EventTypeEnum.isNeedRoadEventUgc(v2XRoadEventEntity.getPoiType())) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG,
|
||||
// "V2X预警--UGC检测:" +
|
||||
// "\n事件详情:" + roadInfoId +
|
||||
// "\n事件详情:" + EventTypeUtils.getPoiTypeStr(v2XRoadEventEntity.getPoiType()) +
|
||||
// "\n车头方向: " + carBearing +
|
||||
// "\n车与事件夹角:" + eventAngle +
|
||||
// "\n已经UGC的事件:" + GsonUtil.jsonFromObject(alertMessageId)
|
||||
// );
|
||||
// 判断是否预警过了
|
||||
if (!alertMessageId.contains(roadInfoId)) {
|
||||
// 判断车辆行驶角度是否与事件相反,相反的话表示已经行驶过去了
|
||||
if (80 <= eventAngle) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "V2X预警UGC--事件与车头角度夹角过大:" +
|
||||
// "\n角度:" + eventAngle + " 度" +
|
||||
// "\n事件详情:" + roadInfoId +
|
||||
// "\n库存事件:" + V2XAlarmServer.mAlertRoadEventList.size()
|
||||
// );
|
||||
|
||||
// 记录已经 UGC 提醒过的数据
|
||||
alertMessageId.add(roadInfoId);
|
||||
|
||||
// 加载数据源
|
||||
V2XMessageEntity<V2XRoadEventEntity> v2xMessageEntity = new V2XMessageEntity<>();
|
||||
// 控制类型
|
||||
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING);
|
||||
// 设置数据
|
||||
v2xMessageEntity.setContent(v2XRoadEventEntity);
|
||||
// 控制展示状态
|
||||
v2xMessageEntity.setShowState(true);
|
||||
// 弹出UGC
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2xMessageEntity);
|
||||
LocalBroadcastManager.getInstance(Utils.getApp()).sendBroadcast(intent);
|
||||
|
||||
}
|
||||
// 移出已经预警的事件列表
|
||||
//V2XAlarmServer.mAlertRoadEventList.remove(v2XRoadEventEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,26 +15,6 @@ public interface IMoGoV2XStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isRoadEventPOIShow();
|
||||
|
||||
/**
|
||||
* 按钮区 V2X道路预警 是否在展示
|
||||
*/
|
||||
boolean isRoadEventButtonShow();
|
||||
|
||||
/**
|
||||
* 头部 V2X道路预警 UI 是否在展示
|
||||
*/
|
||||
boolean isRoadEventWindowShow();
|
||||
|
||||
/**
|
||||
* 头部 他人车辆故障求助 UI 是否在展示
|
||||
*/
|
||||
boolean isOtherSeekHelpWindowShow();
|
||||
|
||||
/**
|
||||
* 地图区域 他人车辆故障求助POI 是否在展示
|
||||
*/
|
||||
boolean isOtherSeekHelpPOIShow();
|
||||
|
||||
/**
|
||||
* 设置 V2X道路预警POI 是否在展示
|
||||
*
|
||||
@@ -43,67 +23,6 @@ public interface IMoGoV2XStatusManager extends IProvider {
|
||||
*/
|
||||
void setRoadEventPOIShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 V2X道路预警 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setRoadEventButtonShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 右侧2/3 头部 V2X道路预警 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setRoadEventWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 右侧2/3 头部 V2X的道路直播 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setRoadLiveCarWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 他人车辆故障求助 UI 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setOtherSeekHelpWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 右侧2/3 全屏 V2X 场景动画 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setV2XAnimationWindowShow(String tag, boolean show);
|
||||
|
||||
/*
|
||||
* 道路事件图片/视频资源 全屏
|
||||
* */
|
||||
void setV2XRoadVideoWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 模拟直播车机 UI 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setLiveCarWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 推送弹窗的状态
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setPushWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 地图区域 推送的 POI 是否在展示
|
||||
*
|
||||
@@ -112,11 +31,4 @@ public interface IMoGoV2XStatusManager extends IProvider {
|
||||
*/
|
||||
void setPushPOIShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 地图区域 疲劳驾驶 是否在展示
|
||||
*
|
||||
* @param tag
|
||||
* @param show
|
||||
*/
|
||||
void setFatigueDrivingWindowShow(String tag, boolean show);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
private static final CopyOnWriteArraySet<V2XRoadEventEntity> mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>();
|
||||
// 上次的道路事件的预警Marker
|
||||
private static IMogoMarker mAlarmInfoMarker;
|
||||
private static IMogoMarker m3DMarker;
|
||||
|
||||
@Override
|
||||
public void drawableLastAllPOI() {
|
||||
@@ -81,7 +80,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
CopyOnWriteArrayList<V2XRoadEventEntity> roadEventEntities = new CopyOnWriteArrayList<>();
|
||||
// 当前车辆数据
|
||||
MogoLocation currentLocation = V2XStatusManager.getInstance().getLocation();
|
||||
|
||||
if (currentLocation != null) {
|
||||
// 重新计算距离
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : mV2XRoadEventEntityArrayList) {
|
||||
@@ -96,7 +94,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
}
|
||||
roadEventEntities.add(v2XRoadEventEntity);
|
||||
}
|
||||
|
||||
// 按照与当前车辆距离排序
|
||||
for (int i = 0; i < roadEventEntities.size(); i++) {
|
||||
for (int j = i; j > 0; j--) {
|
||||
@@ -107,37 +104,17 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
//输出日志查看结果
|
||||
// for (int i = 0; i < roadEventEntities.size(); i++) {
|
||||
// CallerLogger.INSTANCE.w(M_V2X + TAG, "V2X===" +
|
||||
// "事件名称:" + roadEventEntities.get(i).getNoveltyInfo() +
|
||||
// "\t 事件距离:" + roadEventEntities.get(i).getDistance());
|
||||
// }
|
||||
}
|
||||
|
||||
return roadEventEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void analysisV2XRoadEvent(V2XMarkerCardResult markerCardResult) {
|
||||
boolean isShowEventWindow = false;
|
||||
boolean isShowEventButton = false;
|
||||
boolean isOtherSeekHelpWindowShow = false;
|
||||
IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus();
|
||||
if (v2xStatus != null) {
|
||||
//预警Window状态
|
||||
isShowEventWindow = v2xStatus.isRoadEventWindowShow();
|
||||
//预警按钮状态
|
||||
isShowEventButton = v2xStatus.isRoadEventButtonShow();
|
||||
//道路求助的window
|
||||
isOtherSeekHelpWindowShow = v2xStatus.isOtherSeekHelpWindowShow();
|
||||
}
|
||||
try {
|
||||
//当没有预警提示的时候重新绘制地图POI点
|
||||
if (markerCardResult != null && !isShowEventWindow && !isShowEventButton && !isOtherSeekHelpWindowShow) {
|
||||
if (markerCardResult != null) {
|
||||
// 清除上次的道路事件, 这里注意,道路事件的触发和这里是异步操作会触发异常
|
||||
mV2XRoadEventEntityArrayList.clear();
|
||||
|
||||
// 获取探路以及新鲜事儿
|
||||
List<V2XMarkerExploreWay> exploreWayList = markerCardResult.getExploreWay();
|
||||
if (exploreWayList != null) {
|
||||
@@ -149,7 +126,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
v2XRoadEventEntity.setLocation(EntityUtilsKt.toMarkerLocation(markerLocation));
|
||||
// 探路目前只有上报拥堵
|
||||
String poi = markerExploreWay.getPoiType();
|
||||
|
||||
v2XRoadEventEntity.setPoiType(poi);
|
||||
v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay,markerCardResult.getExtras()));
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusDescriptor;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -53,26 +52,6 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
|
||||
return get_bool_val(V2XStatusDescriptor.RoadEventPOI_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRoadEventButtonShow() {
|
||||
return get_bool_val(V2XStatusDescriptor.RoadEventButton_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRoadEventWindowShow() {
|
||||
return get_bool_val(V2XStatusDescriptor.RoadEventWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOtherSeekHelpWindowShow() {
|
||||
return get_bool_val(V2XStatusDescriptor.OtherSeekHelpWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOtherSeekHelpPOIShow() {
|
||||
return get_bool_val(V2XStatusDescriptor.OtherSeekHelpPOI_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoadEventPOIShow(String tag, boolean show) {
|
||||
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
|
||||
@@ -84,62 +63,6 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.RoadEventPOI_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoadEventButtonShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.RoadEventButton_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.RoadEventButton_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.RoadEventButton_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoadEventWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.RoadEventWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.RoadEventWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.RoadEventWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoadLiveCarWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.RoadLiveCarWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.RoadLiveCarWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.RoadLiveCarWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOtherSeekHelpWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.OtherSeekHelpWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.OtherSeekHelpWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.OtherSeekHelpWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setV2XAnimationWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.V2XAnimationWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setV2XRoadVideoWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.V2XRoadVideo_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.V2XRoadVideo_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLiveCarWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.LiveCarWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.LiveCarWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.LiveCarWindow_UI);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setPushWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.PushWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.PushWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.PushWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushPOIShow(String tag, boolean show) {
|
||||
@@ -148,14 +71,7 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.PushWindowPOI_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFatigueDrivingWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.FatigueDrivingWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.FatigueDrivingWindow_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.FatigueDrivingWindow_UI);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 调用所有存储的监听
|
||||
*
|
||||
* @param descriptor
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.api.v2x.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
|
||||
import com.mogo.eagle.core.function.call.v2x.*
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
@@ -58,10 +59,14 @@ object AiRoadMarker {
|
||||
}
|
||||
|
||||
private val checkExpiredTask = Runnable {
|
||||
// val marker = this@AiRoadMarker.marker.get()
|
||||
// if (marker != null) {
|
||||
// unMarker(marker)
|
||||
// }
|
||||
val poi = this.marker.get()
|
||||
val car = this.carLocation.get()
|
||||
if (poi != null && car != null) {
|
||||
val distance = DrivingDirectionUtils.distance(car.first, car.second, poi.poi_lon, poi.poi_lat) * 10000
|
||||
if (distance < 500) {
|
||||
unMarker(poi)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val onClearAllMarker = object : OnClearAllMarker {
|
||||
@@ -78,7 +83,7 @@ object AiRoadMarker {
|
||||
override fun onClearAllMarkers(tag: String) {
|
||||
Logger.d(TAG, "--- onClearAllMarkers ----: tag: $tag")
|
||||
val marker = this@AiRoadMarker.marker.get()
|
||||
if (marker != null) {
|
||||
if (marker != null && tag == V2X_EVENT_ALARM_POI) {
|
||||
Logger.d(TAG, "--- onClearAllMarkers ----: tag: -- 1: $tag")
|
||||
unMarker(marker)
|
||||
}
|
||||
@@ -183,12 +188,6 @@ object AiRoadMarker {
|
||||
try {
|
||||
val loc = arrayOf(location.longitude, location.latitude)
|
||||
carLocation.set(Triple(loc[0], loc[1], location.bearing.toDouble()))
|
||||
// val marker = marker.get() ?: return
|
||||
// val isOutOfRange = isOutOfRange(marker.poi_lon, marker.poi_lat, carLocation.get().first, carLocation.get().second, carLocation.get().third)
|
||||
// if (isOutOfRange) {
|
||||
// Logger.d(TAG, "--- onLocationChanged: isOutOfRange --- ")
|
||||
// unMarker(marker)
|
||||
// }
|
||||
} catch (t: Throwable) {
|
||||
Logger.e(TAG, "error: ${t.message}")
|
||||
}
|
||||
@@ -326,42 +325,34 @@ object AiRoadMarker {
|
||||
fun unMarker(marker: Marker) {
|
||||
Logger.d(TAG, "--- unMarker ---")
|
||||
markers -= marker
|
||||
this.marker.set(null)
|
||||
removeLine()
|
||||
V2XAiRoadEventMarker.removeMarkers(null)
|
||||
handler.removeCallbacks(checkExpiredTask)
|
||||
}
|
||||
|
||||
private fun isOutOfRange(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
|
||||
return !isFrontOfCar(markerLon, markerLat, carLon, carLat, carAngle)
|
||||
}
|
||||
|
||||
private fun isFrontOfCar(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
|
||||
val degree = DrivingDirectionUtils.getDegreeOfCar2Poi2(carLon, carLat, markerLon, markerLat, carAngle)
|
||||
return degree < 90
|
||||
}
|
||||
|
||||
fun receive(marker: Marker) {
|
||||
val cur = this.marker.get()
|
||||
Logger.d(TAG, "receive --- 1 ---")
|
||||
if (cur == marker) {
|
||||
Logger.d(TAG, "receive --- 2 ---")
|
||||
val poi = this.marker.get()
|
||||
val car = this.carLocation.get()
|
||||
if (poi != null && car != null) {
|
||||
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
|
||||
Logger.d(TAG, "receive --- 3 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
|
||||
if (distance < 200) {
|
||||
checkExpired()
|
||||
} else {
|
||||
handler.removeCallbacks(checkExpiredTask)
|
||||
}
|
||||
val poi = this.marker.get()
|
||||
val car = this.carLocation.get()
|
||||
if (poi != null && car != null) {
|
||||
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
|
||||
Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
|
||||
if (distance < 500) {
|
||||
checkExpired()
|
||||
} else {
|
||||
handler.removeCallbacks(checkExpiredTask)
|
||||
}
|
||||
} else {
|
||||
if (poi != null) {
|
||||
checkExpired()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkExpired() {
|
||||
handler.removeCallbacks(checkExpiredTask)
|
||||
handler.postDelayed(checkExpiredTask, 60_000)
|
||||
handler.postDelayed(checkExpiredTask, 10000)
|
||||
}
|
||||
|
||||
data class Marker(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road
|
||||
|
||||
import android.graphics.*
|
||||
import android.util.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
@@ -14,6 +15,7 @@ import com.mogo.module.common.utils.*
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.*
|
||||
import kotlin.Pair
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
object V2XAiRoadEventMarker {
|
||||
|
||||
@@ -29,6 +31,8 @@ object V2XAiRoadEventMarker {
|
||||
|
||||
private val distance = AtomicInteger(0)
|
||||
|
||||
private val overlayManager by lazy { MogoOverlayManager.getInstance() }
|
||||
|
||||
fun drawMarkers(entity: V2XRoadEventEntity): Pair<IMogoPolyline?, List<IMogoMarker>?>? {
|
||||
removeMarkers(current.get())
|
||||
timerTask.get()?.cancel()
|
||||
@@ -69,7 +73,32 @@ object V2XAiRoadEventMarker {
|
||||
v2xMarker()?.drawableAlarmPOI(context(), entity, null)
|
||||
val l2 = entity.noveltyInfo?.location ?: return null
|
||||
v2xLocation.set(MogoLocation().also { it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat() })
|
||||
current.set(Pair(null, markers))
|
||||
|
||||
val options = MogoPolylineOptions()
|
||||
val colors = ArrayList<Int>()
|
||||
colors.add(Color.argb(204, 237, 172, 21))
|
||||
colors.add(Color.argb(0, 255, 255, 255))
|
||||
options.colorValues(colors)
|
||||
val points = ArrayList<MogoLatLng>()
|
||||
|
||||
for (p in polygons) {
|
||||
points.add(MogoLatLng(p.second, p.first))
|
||||
}
|
||||
if (points.size > 2) {
|
||||
points.add(points[0])
|
||||
}
|
||||
options.points(points);
|
||||
options.useGradient(true)
|
||||
options.useFacade(true)
|
||||
options.setGps(false)
|
||||
options.width(5f)
|
||||
options.zIndex(75000f)
|
||||
options.maxIndex(800000f)
|
||||
val line = overlayManager.addPolyline(options)
|
||||
current.set(Pair(line, markers))
|
||||
if (line != null) {
|
||||
line.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@ import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.v2x.data.V2XLocation;
|
||||
import com.mogo.v2x.data.V2XWarningTarget;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -39,7 +40,7 @@ import java.util.List;
|
||||
public class V2XWarningMarker implements IV2XMarker {
|
||||
private static final String TAG = "V2XWarningMarker";
|
||||
private static final String WARNING_ARROWS = "WARNING_ARROWS";
|
||||
private V2XWarningEntity mCloundWarningInfo;
|
||||
private V2XWarningTarget mCloundWarningInfo;
|
||||
private boolean isSelfLineClear = true;//绘制线是否已被清除
|
||||
private final List fillPoints = new ArrayList();//停止线经纬度合集
|
||||
private boolean isFirstLocation = false;
|
||||
@@ -60,7 +61,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
public void drawPOI(Object entity) {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "===drawPOI");
|
||||
mCloundWarningInfo = (V2XWarningEntity) entity;
|
||||
mCloundWarningInfo = (V2XWarningTarget) entity;
|
||||
drawLineWithEntity();
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -109,7 +110,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
warningLocation);
|
||||
|
||||
*/
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime());
|
||||
|
||||
//添加停止线marker
|
||||
//衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
|
||||
@@ -133,7 +134,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "数据为空carLocation == null");
|
||||
}
|
||||
*/
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime());
|
||||
|
||||
}, 0);
|
||||
|
||||
@@ -157,7 +158,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
* startLatLng: 划线起点=停止线上的坐标点
|
||||
* mogoLatLng: 停止线前方50m坐标点
|
||||
* */
|
||||
private void drawRedWarningLineFrontOfStopLine(V2XWarningEntity info, MogoLatLng
|
||||
private void drawRedWarningLineFrontOfStopLine(V2XWarningTarget info, MogoLatLng
|
||||
startLatLng, MogoLatLng mogoLatLng) {
|
||||
if (info != null) {
|
||||
double angle = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, mogoLatLng.lon, mogoLatLng.lat);
|
||||
@@ -166,7 +167,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
if (stopPolyLineMnager != null) {
|
||||
IMogoPolyline polyLine = stopPolyLineMnager.getMogoStopPolyline();
|
||||
MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
|
||||
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng, 25, angle);
|
||||
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng.lon, startLatLng.lat, 25, angle);
|
||||
if (polyLine != null) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "drawStopLine polyLine != null");
|
||||
polyLine.setPoints(Arrays.asList(startLatLng, addMiddleLoc, endLatlng));
|
||||
@@ -178,8 +179,8 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
locations.add(addMiddleLoc);
|
||||
locations.add(endLatlng);
|
||||
lineInfo.setLocations(locations);
|
||||
lineInfo.setHeading(info.heading);
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "drawStopLine width = " + info.getRoadwidth());
|
||||
lineInfo.setHeading(info.getHeading());
|
||||
CallerLogger.INSTANCE.d(TAG, "drawStopLine width = " + info.getRoadwidth());
|
||||
lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
|
||||
stopPolyLineMnager.drawStopPolyline(BridgeApi.INSTANCE.context(), lineInfo);
|
||||
}
|
||||
@@ -231,17 +232,17 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
fillPoints.clear();
|
||||
List stopLines = mCloundWarningInfo.getStopLines();
|
||||
if (stopLines != null && stopLines.size() > 1) {
|
||||
MogoLatLng x = mCloundWarningInfo.getStopLines().get(0);
|
||||
MogoLatLng y = mCloundWarningInfo.getStopLines().get(1);
|
||||
V2XLocation x = mCloundWarningInfo.getStopLines().get(0);
|
||||
V2XLocation y = mCloundWarningInfo.getStopLines().get(1);
|
||||
//两点间的距离
|
||||
float distance = CoordinateUtils.calculateLineDistance(x.lon, x.lat, y.lon, y.lat);
|
||||
float distance = CoordinateUtils.calculateLineDistance(x.getLon(), x.getLat(), y.getLon(), y.getLat());
|
||||
float average = distance / 3;
|
||||
//两点间的角度
|
||||
double angle = Trigonometric.getAngle(x.lon, x.lat, y.lon, y.lat);
|
||||
double angle = Trigonometric.getAngle(x.getLon(), x.getLat(), y.getLon(), y.getLat());
|
||||
//根据距离和角度获取下个点的经纬度
|
||||
fillPoints.add(x);
|
||||
for (int i = 1; i < 3; i++) {
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(x, average * i, angle);
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(x.getLon(), x.getLat(), average * i, angle);
|
||||
fillPoints.add(newLocation);
|
||||
}
|
||||
fillPoints.add(y);
|
||||
@@ -265,12 +266,12 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
marker.removeMarkers(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
|
||||
}
|
||||
for (int i = 0; i < fillPoints.size(); i++) {
|
||||
V2XWarningEntity entity = new V2XWarningEntity();
|
||||
V2XWarningTarget entity = new V2XWarningTarget();
|
||||
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
|
||||
entity.setLat(latLng.lat);
|
||||
entity.setLon(latLng.lon);
|
||||
entity.heading = mCloundWarningInfo.heading;
|
||||
V2XWarnDataDrawer.getInstance().renderStopLineData(entity);
|
||||
entity.setHeading(mCloundWarningInfo.getHeading());
|
||||
V2XWarnDataDrawer.getInstance().renderStopLineData(entity.getLon(), entity.getLat());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -279,7 +280,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
}
|
||||
|
||||
private MogoLatLng getMogoLat(MogoLatLng latlng) {
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(latlng, mCloundWarningInfo.getStopLineDistance(),
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(latlng.lon, latlng.lat, mCloundWarningInfo.getStopLineDistance(),
|
||||
mCloundWarningInfo.getAngle());
|
||||
return newLocation;
|
||||
}
|
||||
@@ -293,11 +294,11 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
}
|
||||
MogoLatLng newLocation = new MogoLatLng(0, 0);
|
||||
if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null && mCloundWarningInfo.getStopLines().size() > 1) {
|
||||
MogoLatLng x = mCloundWarningInfo.getStopLines().get(0);
|
||||
MogoLatLng y = mCloundWarningInfo.getStopLines().get(1);
|
||||
float distance = CoordinateUtils.calculateLineDistance(x.lon, x.lat, y.lon, y.lat);
|
||||
double angle = Trigonometric.getAngle(x.lon, x.lat, y.lon, y.lat);
|
||||
newLocation = Trigonometric.getNewLocation(x, distance * 0.5, angle);
|
||||
V2XLocation x = mCloundWarningInfo.getStopLines().get(0);
|
||||
V2XLocation y = mCloundWarningInfo.getStopLines().get(1);
|
||||
float distance = CoordinateUtils.calculateLineDistance(x.getLon(), x.getLat(), y.getLat(), y.getLat());
|
||||
double angle = Trigonometric.getAngle(x.getLat(), x.getLat(), y.getLon(), y.getLat());
|
||||
newLocation = Trigonometric.getNewLocation(x.getLon(), x.getLat(), distance * 0.5, angle);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线返回坐标点数量不正确" + mCloundWarningInfo.getStopLines().size());
|
||||
}
|
||||
@@ -335,7 +336,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
startLatlng = new MogoLatLng(lat, lon);
|
||||
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
|
||||
//扩展点为了渐变色添加
|
||||
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2,
|
||||
addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
|
||||
Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==扩展点为了渐变色添加:" +
|
||||
String.valueOf(Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat)));
|
||||
@@ -368,7 +369,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
/**
|
||||
* 侧方目标物与预碰撞点连线,并且更新数据 TODO 需要实时给行人当前位置
|
||||
*/
|
||||
private void drawOtherObjectLine(V2XWarningEntity info) {
|
||||
private void drawOtherObjectLine(V2XWarningTarget info) {
|
||||
if (info != null) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "info != null");
|
||||
IMoGoPersonWarnPolylineManager personWarnPolylineManager = BridgeApi.INSTANCE.v2xPersonWarnPolyline();
|
||||
@@ -379,7 +380,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
MogoLatLng startLatlng = new MogoLatLng(info.getLat(), info.getLon());//识别物坐标
|
||||
MogoLatLng endLatlng = new MogoLatLng(info.getCollisionLat(), info.getCollisionLon());//预碰撞点坐标
|
||||
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);//识别物到碰撞点之间的距离
|
||||
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2,
|
||||
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
|
||||
Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));//补点
|
||||
if (polyLine != null) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与碰撞点连线 != null");
|
||||
@@ -394,7 +395,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
locations.add(addMiddleLoc);
|
||||
locations.add(endLatlng);
|
||||
lineInfo.setLocations(locations);
|
||||
lineInfo.setHeading(info.heading);
|
||||
lineInfo.setHeading(info.getHeading());
|
||||
lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
|
||||
personWarnPolylineManager.drawPersonWarnPolyline(BridgeApi.INSTANCE.context(), lineInfo);
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
@@ -415,7 +416,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
int count = (int) (distance / 5);
|
||||
for (int i = 0; i < count; i++) {
|
||||
MogoLatLng newLo = Trigonometric.getNewLocation(
|
||||
startLatLng, 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
|
||||
startLatLng.getLon(), startLatLng.getLat(), 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
|
||||
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue());
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "小箭头位置" + newLo);
|
||||
}
|
||||
@@ -428,7 +429,10 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && isSelfLineClear == false) {
|
||||
if (mCloundWarningInfo != null) {
|
||||
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
|
||||
V2XLocation v2XLocation = new V2XLocation();
|
||||
v2XLocation.setLat(latLng.getLatitude());
|
||||
v2XLocation.setLon(latLng.getLongitude());
|
||||
mCloundWarningInfo.setCarLocation(v2XLocation);
|
||||
}
|
||||
//衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
|
||||
//drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
|
||||
|
||||
@@ -34,7 +34,7 @@ public class RoadConditionUtils {
|
||||
* 显示Toast
|
||||
*/
|
||||
private static void showTip() {
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoice("已反馈", null);
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoiceWithLevel("已反馈", AIAssist.LEVEL2,null);
|
||||
TipToast.tip("已反馈");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,12 +82,12 @@ public class CarZegoLiveVideoView extends RoundLayout {
|
||||
*/
|
||||
public void startLive() {
|
||||
if (mSurfaceView != null) {
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice(AbsMogoApplication.getApp().getString(R.string.v2x_voice_see_front_car_live));
|
||||
//AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice(AbsMogoApplication.getApp().getString(R.string.v2x_voice_see_front_car_live));
|
||||
playLiveVideo();
|
||||
mClLoadError.setVisibility(GONE);
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "startLive");
|
||||
} else {
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice(AbsMogoApplication.getApp().getString(R.string.v2x_voice_see_front_car_live_error));
|
||||
//AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice(AbsMogoApplication.getApp().getString(R.string.v2x_voice_see_front_car_live_error));
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "没有找到可直播车机");
|
||||
@@ -126,7 +126,7 @@ public class CarZegoLiveVideoView extends RoundLayout {
|
||||
@Override
|
||||
public void onError(String errorMsg) {
|
||||
refreshStatusToListener(false);
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoice("直播获取识败,可以对我说重试", null);
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoiceWithLevel("直播获取识败,可以对我说重试", AIAssist.LEVEL3);
|
||||
stopLive();
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
|
||||
@@ -209,7 +209,7 @@ public class V2XCrossRoadVideoView extends RoundLayout {
|
||||
mClLoadError.setVisibility(GONE);
|
||||
} else if (event < 0) {
|
||||
refreshStatusToListener(false);
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoice("直播获取识败,可以对我说重试", null);
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoiceWithLevel("直播获取识败,可以对我说重试", AIAssist.LEVEL3);
|
||||
stopLive();
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
|
||||
@@ -150,7 +150,7 @@ public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
} else if (event < 0) {
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoice("直播获取失败,可以对我说重试", null);
|
||||
AIAssist.getInstance(Utils.getApp()).speakTTSVoiceWithLevel("直播获取失败,可以对我说重试", AIAssist.LEVEL3);
|
||||
stopLive(mCarLiveInfo);
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
|
||||
Reference in New Issue
Block a user