同步212 版本
This commit is contained in:
@@ -19,9 +19,10 @@ public class HostConst {
|
||||
public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com";
|
||||
public static final String SOCKET_CENTER_DOMAIN = "socketRegion";
|
||||
|
||||
public static final String BINDING_SN_HOST = "https://mygateway.zhidaozhixing.com/cmdbapi/"; //中台提供的接口服务
|
||||
public static final String BINDING_SN_HOST_TEST = "https://mygateway.zhidaozhixing.com/cmdbapitest/"; //中台提供的接口服务测试
|
||||
// public static final String UPGRADE_APP_HOST_TEST = "http://10.0.200.12:32423?/";
|
||||
public static final String UPGRADE_APP_HOST = "http://eagle-mis.zhidaozhixing.com/";
|
||||
|
||||
public static final String CMDB_HOST = "http://eagle-mis.zhidaozhixing.com/eagleEye-mis/cmdbapi/";
|
||||
|
||||
public static final String UPGRADE_APP_HOST = "http://10.0.200.12:32423?/";
|
||||
|
||||
}
|
||||
|
||||
@@ -5,10 +5,11 @@ import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.traffic.threatLevelColor
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
@@ -18,19 +19,19 @@ import com.mogo.module.common.constants.DataTypes
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/18 11:12 上午
|
||||
* 交通元素 2D\3D绘制
|
||||
* 此类用于obu/v2x预警绘制交通元素 2D\3D绘制
|
||||
* obu:与其进行调试单独展示,与debugview上感知开关相关联
|
||||
* v2x:绘制云端预警marker,不会做感知控制管理,后续根据注解的方式来控制v2x业务
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object TrafficMarkerDrawer {
|
||||
|
||||
private val TAG = "TrafficMarkerDrawer"
|
||||
private const val TAG = "TrafficMarkerDrawer"
|
||||
|
||||
private var mContext: Context? = null
|
||||
|
||||
// 动画持续时间 TODO 150
|
||||
private val stepTime = 50L
|
||||
// 动画持续时间
|
||||
private const val stepTime = 150L
|
||||
|
||||
// 维护Obu识别的他车集合
|
||||
private val mTrafficMap = ConcurrentHashMap<String, TrafficData>()
|
||||
@@ -46,8 +47,9 @@ object TrafficMarkerDrawer {
|
||||
object : Handler(WorkThreadHandler.newInstance("other_traffic_drawer").looper) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
// TODO 因为与自动驾驶的感知重合,临时关掉OBU车辆绘制
|
||||
drawerTrafficInfo()
|
||||
if (FunctionBuildConfig.debugTrackerProvider == 1) {
|
||||
drawerTrafficInfo()
|
||||
}
|
||||
// 延时50毫秒重复发送自己,定时轮询进行车辆绘制,可以及时将已经不存在车辆删除
|
||||
sendEmptyMessageDelayed(0, 50L)
|
||||
}
|
||||
@@ -58,15 +60,6 @@ object TrafficMarkerDrawer {
|
||||
mDrawerHandler.sendEmptyMessageDelayed(1, 0L)
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加识别的数据
|
||||
*/
|
||||
fun addTrafficInfo(trafficData: TrafficData) {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新识别数据,V2V预警的时候需要修改车辆颜色
|
||||
*/
|
||||
@@ -80,19 +73,20 @@ object TrafficMarkerDrawer {
|
||||
* 更新识别数据位置
|
||||
*/
|
||||
fun updateITrafficLocationInfo(trafficData: TrafficData) {
|
||||
if (trafficData != null && !TextUtils.isEmpty(trafficData.uuid)) {
|
||||
val tempTraffic = mTrafficMap[trafficData.uuid]
|
||||
if (tempTraffic != null) {
|
||||
tempTraffic.lat = trafficData.lat
|
||||
tempTraffic.lon = trafficData.lon
|
||||
tempTraffic.heading = trafficData.heading
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = tempTraffic
|
||||
}
|
||||
} else {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
}
|
||||
if (FunctionBuildConfig.debugTrackerProvider != 1) {
|
||||
return
|
||||
}
|
||||
val tempTraffic = mTrafficMap[trafficData.uuid]
|
||||
if (tempTraffic != null) {
|
||||
tempTraffic.lat = trafficData.lat
|
||||
tempTraffic.lon = trafficData.lon
|
||||
tempTraffic.heading = trafficData.heading
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = tempTraffic
|
||||
}
|
||||
} else {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,6 +95,9 @@ object TrafficMarkerDrawer {
|
||||
* 更新识别数据颜色
|
||||
*/
|
||||
fun updateITrafficThreatLevelInfo(trafficData: TrafficData) {
|
||||
if (FunctionBuildConfig.debugTrackerProvider != 1) {
|
||||
return
|
||||
}
|
||||
if (trafficData != null && !TextUtils.isEmpty(trafficData.uuid)) {
|
||||
val tempTraffic = mTrafficMap[trafficData.uuid]
|
||||
if (tempTraffic != null) {
|
||||
@@ -162,10 +159,9 @@ object TrafficMarkerDrawer {
|
||||
*/
|
||||
private fun drawObuRecognizedDataMarker(trafficData: TrafficData) {
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
)
|
||||
// Log.e("liyz", "drawObuRecognizedDataMarker trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel)
|
||||
if (trafficData.type != null) {
|
||||
val resId: Int = trafficData.type.traffic3DIconId
|
||||
|
||||
@@ -181,30 +177,18 @@ object TrafficMarkerDrawer {
|
||||
.icon3DRes(resId)
|
||||
.rotate(trafficData.heading.toFloat())
|
||||
.position(
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
)
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
)
|
||||
)
|
||||
|
||||
if (trafficData.type != TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE) {
|
||||
// 修改颜色
|
||||
when (trafficData.threatLevel) {
|
||||
1 -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#D8D8D8FF")
|
||||
}
|
||||
2 -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#FFD53EFF")
|
||||
}
|
||||
3 -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#FF3C45FF")
|
||||
}
|
||||
else -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#D8D8D8FF")
|
||||
}
|
||||
}
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor(trafficData.threatLevelColor())
|
||||
}
|
||||
val marker = MogoMarkerManager.getInstance(mContext).addMarker(DataTypes.TYPE_MARKER_OBU_DATA, options)
|
||||
val marker = MogoMarkerManager.getInstance(mContext)
|
||||
.addMarker(DataTypes.TYPE_MARKER_OBU_DATA, options)
|
||||
|
||||
// 缓存3D资源
|
||||
mMarkerCachesResMd5Values[resIdVal] = marker.markerResName
|
||||
@@ -219,43 +203,25 @@ object TrafficMarkerDrawer {
|
||||
* 带动画的修改Marker
|
||||
*/
|
||||
private fun changeDynamicMarker(
|
||||
marker: IMogoMarker,
|
||||
trafficData: TrafficData
|
||||
marker: IMogoMarker,
|
||||
trafficData: TrafficData
|
||||
) {
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
)
|
||||
// Log.e("liyz",
|
||||
// "trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
// )
|
||||
|
||||
if (trafficData.type != TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE) {
|
||||
// 修改颜色
|
||||
when (trafficData.threatLevel) {
|
||||
1 -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#D8D8D8FF")
|
||||
}
|
||||
2 -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#FFD53EFF")
|
||||
}
|
||||
3 -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#FF3C45FF")
|
||||
}
|
||||
else -> {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor("#D8D8D8FF")
|
||||
}
|
||||
}
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor(trafficData.threatLevelColor())
|
||||
}
|
||||
|
||||
try {
|
||||
marker.addDynamicAnchorPosition(
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
),
|
||||
trafficData.heading.toFloat(),
|
||||
stepTime
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
),
|
||||
trafficData.heading.toFloat(),
|
||||
stepTime
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -38,6 +39,8 @@ public class MarkerExploreWay implements Serializable {
|
||||
// 1 需要用户判断是否拥堵 进行UGC问答
|
||||
private int infoCheckNode;
|
||||
|
||||
public Map<String, Object> extras = null;
|
||||
|
||||
public String getAddr() {
|
||||
if (TextUtils.isEmpty(addr)) {
|
||||
return "未知道路";
|
||||
@@ -141,6 +144,7 @@ public class MarkerExploreWay implements Serializable {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
|
||||
public int getInfoIdInt() {
|
||||
try {
|
||||
return Integer.parseInt(infoId);
|
||||
|
||||
@@ -112,11 +112,11 @@ enum class EventTypeEnum(
|
||||
GHOST_PROBE("10024", "前方盲区行人预警", "前方盲区行人预警", R.drawable.icon_warning_v2x_pedestrian_crossing,
|
||||
"前方盲区行人通行,请注意", "前方盲区即将有行人通过,请减速慢行"),
|
||||
|
||||
//接管 TODO
|
||||
// TAKE_OVER_EVENT(
|
||||
// "20000", "注意周围、立即接管", "注意周围、立即接管", R.drawable.icon_warning_take_over,
|
||||
// "注意周围、立即接管", "自动驾驶退出请立即接管"
|
||||
// ),
|
||||
//接管
|
||||
TAKE_OVER_EVENT(
|
||||
"20000", "注意周围、立即接管", "注意周围、立即接管", R.drawable.icon_warning_take_over,
|
||||
"注意周围、立即接管", "自动驾驶退出请立即接管"
|
||||
),
|
||||
|
||||
// 前方静止or慢速车辆报警
|
||||
ALERT_FRONT_CAR("99999"),
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.mogo.module.common.enums
|
||||
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_AVW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BSW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_CLW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_DNPW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_EBW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FCW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LCW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LTA
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_OPT_LINE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VRU
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VRU_RI
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2V
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.enums.isLeft
|
||||
import com.mogo.eagle.core.data.enums.isRight
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
class EventTypeHelper {
|
||||
|
||||
companion object {
|
||||
|
||||
//变道预警
|
||||
@BizConfig(V2V, "", BIZ_LCW)
|
||||
fun getLCW(
|
||||
appId: Int,
|
||||
direction: WarningDirectionEnum,
|
||||
data: ((alert: String, tts: String) -> Unit)
|
||||
) {
|
||||
when {
|
||||
direction.isLeft() -> {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString() + "左"),
|
||||
EventTypeEnum.getWarningTts(appId.toString() + "左")
|
||||
)
|
||||
}
|
||||
direction.isRight() -> {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString() + "右"),
|
||||
EventTypeEnum.getWarningTts(appId.toString() + "右")
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString()),
|
||||
EventTypeEnum.getWarningTts(appId.toString())
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//车辆失控预警
|
||||
@BizConfig(V2V, "", BIZ_CLW)
|
||||
fun getCLW(
|
||||
appId: Int,
|
||||
direction: WarningDirectionEnum,
|
||||
data: ((alert: String, tts: String) -> Unit)
|
||||
) {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString() + direction.desc),
|
||||
EventTypeEnum.getWarningContent(appId.toString() + direction.desc)
|
||||
)
|
||||
}
|
||||
|
||||
//左转辅助
|
||||
@BizConfig(V2V, "", BIZ_LTA)
|
||||
fun getLTA(appId: Int, data: ((alert: String, tts: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString()),
|
||||
EventTypeEnum.getWarningTts(appId.toString())
|
||||
)
|
||||
}
|
||||
|
||||
//异常车辆提醒
|
||||
@BizConfig(V2V, "", BIZ_AVW)
|
||||
fun getAVW(
|
||||
appId: Int,
|
||||
direction: WarningDirectionEnum,
|
||||
data: ((alert: String, tts: String) -> Unit)
|
||||
) {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString() + direction.desc),
|
||||
EventTypeEnum.getWarningTts(appId.toString() + direction.desc)
|
||||
)
|
||||
}
|
||||
|
||||
//盲区预警
|
||||
@BizConfig(V2V, "", BIZ_BSW)
|
||||
fun getBSW(
|
||||
appId: Int,
|
||||
direction: WarningDirectionEnum,
|
||||
data: ((alert: String, tts: String, visualAngle: Boolean) -> Unit)
|
||||
) {
|
||||
when {
|
||||
direction.isLeft() -> {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString() + "左"),
|
||||
EventTypeEnum.getWarningTts(appId.toString() + "左"),
|
||||
true
|
||||
)
|
||||
}
|
||||
direction.isRight() -> {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString() + "右"),
|
||||
EventTypeEnum.getWarningTts(appId.toString() + "右"),
|
||||
true
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString()),
|
||||
EventTypeEnum.getWarningTts(appId.toString()),
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//弱势交通碰撞预警
|
||||
@BizConfig(V2N, "", BIZ_VRU)
|
||||
fun getVRU(data: ((appId: Int, tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.content
|
||||
)
|
||||
}
|
||||
|
||||
//弱势交通逆行预警
|
||||
@BizConfig(V2N, "", BIZ_VRU_RI)
|
||||
fun getVRURI(data: ((appId: Int, tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(),
|
||||
"行人逆行预警",
|
||||
"行人逆行预警"
|
||||
)
|
||||
}
|
||||
|
||||
//最优车道
|
||||
@BizConfig(V2N, "", BIZ_OPT_LINE)
|
||||
fun getOptLine(data: ((appId: Int, tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.tts,
|
||||
EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.content
|
||||
)
|
||||
}
|
||||
|
||||
//前方道路拥堵预警
|
||||
fun getTJW(data: ((appId: Int, tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.FOURS_BLOCK_UP.poiType.toInt(),
|
||||
EventTypeEnum.FOURS_BLOCK_UP.tts,
|
||||
EventTypeEnum.FOURS_BLOCK_UP.content
|
||||
)
|
||||
}
|
||||
|
||||
//前车急刹
|
||||
@BizConfig(V2V, "", BIZ_EBW)
|
||||
fun getEBW(appId: Int, data: ((tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString()),
|
||||
EventTypeEnum.getWarningTts(appId.toString())
|
||||
)
|
||||
}
|
||||
|
||||
//前向碰撞预警
|
||||
@BizConfig(V2V, "", BIZ_FCW)
|
||||
fun getFCW(appId: Int, data: ((tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString()),
|
||||
EventTypeEnum.getWarningTts(appId.toString())
|
||||
)
|
||||
}
|
||||
|
||||
//逆向超车预警
|
||||
@BizConfig(V2V, "", BIZ_DNPW)
|
||||
fun getDNPW(appId: Int, data: ((tts: String, content: String) -> Unit)) {
|
||||
data.invoke(
|
||||
EventTypeEnum.getWarningContent(appId.toString()),
|
||||
EventTypeEnum.getWarningTts(appId.toString())
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class DrivingDirectionUtils {
|
||||
return Math.sqrt(Math.pow(x1 - x2, 2.0) + Math.pow(y1 - y2, 2.0));
|
||||
}
|
||||
|
||||
private static double getAngle(double sx, double sy, double x1, double y1, double x2, double y2) {
|
||||
public static double getAngle(double sx, double sy, double x1, double y1, double x2, double y2) {
|
||||
x1 = x1 - sx;
|
||||
y1 = y1 - sy;
|
||||
x2 = x2 - sx;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user