[6.9.0]remove identify beatuy mode
This commit is contained in:
@@ -216,7 +216,6 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.swDevelopMode
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbADASLog
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbAppUpgrade
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbAppVersionInfo
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbBeautyMode
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbBusStationStrategyBorderPoint
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbCarAperture
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbChangeAutoPilotStatus
|
||||
@@ -1017,12 +1016,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsRainMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
tbBeautyMode.isChecked = FunctionBuildConfig.isBeautyMode
|
||||
//感知优化模式
|
||||
tbBeautyMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isBeautyMode = isChecked
|
||||
}
|
||||
|
||||
tbObuWarningFusionUnion.isChecked = FunctionBuildConfig.isObuWarningFusionUnion
|
||||
tbObuWarningFusionUnion.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isObuWarningFusionUnion = isChecked
|
||||
@@ -2123,16 +2116,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tvGitBranchInfo.text = "Git分支:${AppConfigInfo.workingBranchName}"
|
||||
tvAppBuildTimeInfo.text = "版本构建时间:${AppConfigInfo.appBuildTime}"
|
||||
|
||||
if (tbBeautyMode.isVisible) {
|
||||
val version = ParseVersionUtils.parseVersion(
|
||||
true,
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()
|
||||
)
|
||||
if (version >= 30100 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbBeautyMode.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态中心
|
||||
*/
|
||||
|
||||
@@ -266,18 +266,6 @@
|
||||
android:textOn="关闭雨天模式"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbBeautyMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启感知优化模式"
|
||||
android:textOn="关闭感知优化模式"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObuWarningFusionUnion"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -31,7 +31,7 @@ class IdentifyBeautifyDataDrawer : Identify {
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
override fun renderAdasRecognizedResult(resultList: List<TrackedObject>?) {
|
||||
if (resultList == null || resultList.isEmpty()) {
|
||||
if (resultList.isNullOrEmpty()) {
|
||||
TrackManager.getInstance().clearAll()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2,16 +2,13 @@ package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
@@ -27,22 +24,16 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
internal val originDataDrawer = IdentifyOriginDataDrawer()
|
||||
}
|
||||
|
||||
object UserIdentify {
|
||||
internal val beautifyDataDrawer = IdentifyBeautifyDataDrawer()
|
||||
}
|
||||
|
||||
object AiIdentify {
|
||||
internal val aiCloudDataDrawer = IdentifyAiCloudDataDrawer()
|
||||
}
|
||||
|
||||
private var identify: Identify? = null
|
||||
private var identify: Identify = DriverIdentify.originDataDrawer
|
||||
private var aiCloudIdentify: Identify? = null
|
||||
private var startTime: Long = 0L
|
||||
private var dockerVersion: String? = null
|
||||
|
||||
fun initType() {
|
||||
drawType("默认开启感知优化,等待docker版本")
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
aiCloudIdentify = AiIdentify.aiCloudDataDrawer
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
CallerObuWarningListenerManager.addListener(TAG, this)
|
||||
@@ -53,16 +44,6 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
dockerVersion = carConfigResp.dockVersion
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_ADAS_RECT_DATA,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
private fun drawType(type: String) {
|
||||
|
||||
}
|
||||
|
||||
private const val MSG_DATA_TRACK = 0
|
||||
private const val MSG_DATA_AI_TRACK = 1
|
||||
private const val MSG_DATA_WARNING = 2
|
||||
@@ -76,46 +57,6 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
object : Handler(WorkThreadHandler.newInstance("IdentifyFactoryDrawer").looper) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
|
||||
if (identify == null) {
|
||||
if (dockerVersion != null && dockerVersion!!.isNotEmpty()) {
|
||||
try {
|
||||
val version = ParseVersionUtils.parseVersion(true, dockerVersion)
|
||||
identify =
|
||||
if (version >= 30100 && isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
FunctionBuildConfig.isBeautyMode = false
|
||||
drawType("关闭感知优化模式")
|
||||
DriverIdentify.originDataDrawer
|
||||
} else {
|
||||
FunctionBuildConfig.isBeautyMode = true
|
||||
drawType("开启感知优化模式")
|
||||
UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
drawType("解析docker异常:$dockerVersion")
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (!FunctionBuildConfig.isBeautyMode) {
|
||||
// 非感知美化优化模式,清除旧数据,使用 DriverIdentify originDataDrawer 原始数据绘制
|
||||
if (identify is IdentifyBeautifyDataDrawer) {
|
||||
identify!!.clearOldMarker()
|
||||
drawType("isBeautyMode 模式改变,关闭感知优化模式")
|
||||
identify = DriverIdentify.originDataDrawer
|
||||
}
|
||||
} else {
|
||||
// 感知优化模式,清除旧数据,使用 UserIdentify beautifyDataDrawer 优化数据
|
||||
if (identify is IdentifyOriginDataDrawer) {
|
||||
identify!!.clearOldMarker()
|
||||
drawType("isBeautyMode 模式改变,开启感知优化模式")
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
}
|
||||
|
||||
when (msg.what) {
|
||||
MSG_CHECK -> {
|
||||
if (startTime == 0L) {
|
||||
@@ -126,14 +67,14 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
val internal = TimeUnit.NANOSECONDS.toMillis(endTime - startTime)
|
||||
if (internal >= 1000) {
|
||||
lostFrame(internal.toString())
|
||||
identify!!.clearOldMarker()
|
||||
identify.clearOldMarker()
|
||||
}
|
||||
sendEmptyMessageDelayed(MSG_CHECK, 1000L)
|
||||
}
|
||||
|
||||
MSG_DATA_TRACK -> {
|
||||
if (msg.obj is List<*>) {
|
||||
identify!!.renderAdasRecognizedResult(msg.obj as List<TrackedObject>?)
|
||||
identify.renderAdasRecognizedResult(msg.obj as List<TrackedObject>?)
|
||||
startTime = System.nanoTime()
|
||||
}
|
||||
}
|
||||
@@ -149,24 +90,24 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
|
||||
MSG_DATA_WARNING -> {
|
||||
if (msg.obj is List<*>) {
|
||||
identify!!.renderPlanningWarningObj(msg.obj as List<MessagePad.PlanningObject>?)
|
||||
identify.renderPlanningWarningObj(msg.obj as List<MessagePad.PlanningObject>?)
|
||||
}
|
||||
}
|
||||
|
||||
MSG_DATA_OBU_WARNING_UPDATE -> {
|
||||
if (msg.obj is TrafficData) {
|
||||
identify!!.renderOBUWarningObj(true, msg.obj as TrafficData)
|
||||
identify.renderOBUWarningObj(true, msg.obj as TrafficData)
|
||||
}
|
||||
}
|
||||
|
||||
MSG_DATA_OBU_WARNING_REMOVE -> {
|
||||
if (msg.obj is TrafficData) {
|
||||
identify!!.renderOBUWarningObj(false, msg.obj as TrafficData)
|
||||
identify.renderOBUWarningObj(false, msg.obj as TrafficData)
|
||||
}
|
||||
}
|
||||
|
||||
MSG_DATA_CLEAR -> {
|
||||
identify!!.clearOldMarker()
|
||||
identify.clearOldMarker()
|
||||
}
|
||||
|
||||
MSG_DATA_AI_CLEAR -> {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class TrackManager {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void renderPlanningWarningObj(List<MessagePad.PlanningObject> planningObjects) {
|
||||
WarningHelper.INSTANCE.renderPlanningWarningObj(planningObjects, mMarkersCaches);
|
||||
|
||||
}
|
||||
|
||||
public synchronized void renderOBUWarningObj(boolean exist, TrafficData obuTrafficData) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.traffic.threatLevelColor
|
||||
@@ -15,11 +14,6 @@ import java.util.function.Consumer
|
||||
object WarningHelper {
|
||||
|
||||
//感知物预警各自先以帧数更新保持,不做同一个集合的融合处理(以卫星时间做判断先后,可能会出现不同ip节点间的回溯问题)
|
||||
/**
|
||||
* planning 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private val pncWarningBeautyTrafficData = ConcurrentHashMap<String, PlanningTrack>()
|
||||
|
||||
/**
|
||||
* planning 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
@@ -30,37 +24,6 @@ object WarningHelper {
|
||||
*/
|
||||
private val obuWarningTrafficData = ConcurrentHashMap<String, TrafficData>()
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
fun renderPlanningWarningObj(
|
||||
planningObjects: List<PlanningObject>?,
|
||||
mMarkersCaches: ConcurrentHashMap<String, TrackObj>
|
||||
) {
|
||||
pncWarningBeautyTrafficData.clear()
|
||||
//处于美化模式或者自动驾驶状态下展示
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || getAutoPilotStatusInfo().state == 2) {
|
||||
if (planningObjects == null) {
|
||||
return
|
||||
}
|
||||
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
|
||||
val trackId = planningObj.uuid.toString()
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
mMarkersCaches[trackId] ?: return@Consumer
|
||||
if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示
|
||||
pncWarningBeautyTrafficData[trackId] = PlanningTrack(
|
||||
"#D65D5AFF-drawColor",
|
||||
getCurWgs84SatelliteTime()
|
||||
)
|
||||
} else if (planningObj.type == 1) { //1是避障和择机的障碍物,障碍物车身黄色提示
|
||||
pncWarningBeautyTrafficData[trackId] = PlanningTrack(
|
||||
"#E4DD94FF-drawColor",
|
||||
getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
fun renderPlanningOriginWarningObj(
|
||||
planningObjects: List<PlanningObject>?,
|
||||
@@ -110,48 +73,31 @@ object WarningHelper {
|
||||
return ""
|
||||
}
|
||||
|
||||
fun getPncColor(uuid: String, color:((String) -> Unit)) {
|
||||
if(!FunctionBuildConfig.isPNCWarning){
|
||||
fun getPncColor(uuid: String, color: ((String) -> Unit)) {
|
||||
if (!FunctionBuildConfig.isPNCWarning) {
|
||||
color.invoke("")
|
||||
return
|
||||
}
|
||||
if (FunctionBuildConfig.isBeautyMode) {
|
||||
// 判断物体是否有预警信息
|
||||
if (pncWarningBeautyTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = pncWarningBeautyTrafficData[uuid]
|
||||
if (planningTrack != null && !timeOut(planningTrack.time)) {
|
||||
color.invoke("${planningTrack.color}-drawColor")
|
||||
} else {
|
||||
val c = pncWarningBeautyTrafficData.remove(uuid)
|
||||
color.invoke("${c?.color}-resetColor")
|
||||
}
|
||||
return
|
||||
// 判断物体是否有预警信息
|
||||
if (pncWarningOriginTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = pncWarningOriginTrafficData[uuid]
|
||||
if (planningTrack != null && !timeOut(planningTrack.time)) {
|
||||
color.invoke("${planningTrack.color}-drawColor")
|
||||
} else {
|
||||
val c = pncWarningOriginTrafficData.remove(uuid)
|
||||
color.invoke("${c?.color}-resetColor")
|
||||
}
|
||||
color.invoke("")
|
||||
} else {
|
||||
// 判断物体是否有预警信息
|
||||
if (pncWarningOriginTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = pncWarningOriginTrafficData[uuid]
|
||||
if (planningTrack != null && !timeOut(planningTrack.time)) {
|
||||
color.invoke("${planningTrack.color}-drawColor")
|
||||
} else {
|
||||
val c = pncWarningOriginTrafficData.remove(uuid)
|
||||
color.invoke("${c?.color}-resetColor")
|
||||
}
|
||||
return
|
||||
}
|
||||
color.invoke("")
|
||||
return
|
||||
}
|
||||
color.invoke("")
|
||||
}
|
||||
|
||||
fun remove(key:String){
|
||||
pncWarningBeautyTrafficData.remove(key)
|
||||
fun remove(key: String) {
|
||||
pncWarningOriginTrafficData.remove(key)
|
||||
obuWarningTrafficData.remove(key)
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
pncWarningBeautyTrafficData.clear()
|
||||
pncWarningOriginTrafficData.clear()
|
||||
obuWarningTrafficData.clear()
|
||||
}
|
||||
|
||||
@@ -87,17 +87,6 @@ object FunctionBuildConfig {
|
||||
@JvmField
|
||||
var overTakeSpeed = 10.0
|
||||
|
||||
/**
|
||||
* 是否是感知优化模式
|
||||
* 默认开启
|
||||
* 打开后可实现感知优化效果
|
||||
* 1、静止车辆抖动优化
|
||||
* 2、静止车辆航向角和位置按车道方向优化
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var isBeautyMode = true
|
||||
|
||||
/**
|
||||
* 开启roma自由/循迹路线
|
||||
* 0:自由模式
|
||||
|
||||
Reference in New Issue
Block a user