Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_280_220608_2.8.0' into dev_robotaxi-d-app-module_280_220608_2.8.0
This commit is contained in:
@@ -4,14 +4,16 @@ import android.annotation.SuppressLint
|
||||
import android.util.Log
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.function.Consumer
|
||||
import kotlin.collections.ArrayList
|
||||
@@ -21,12 +23,19 @@ import kotlin.collections.ArrayList
|
||||
* @date 2021/10/19 10:45 上午
|
||||
* 域控制器识别信息绘制
|
||||
*/
|
||||
class IdentifyOriginDataDrawer : Identify {
|
||||
class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "IdentifyDataDrawer"
|
||||
}
|
||||
|
||||
init {
|
||||
// 添加 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private var mAutopilotStatus: Int = 0 //自动驾驶状态
|
||||
|
||||
/**
|
||||
* 上一帧数据的缓存
|
||||
*/
|
||||
@@ -58,42 +67,45 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
override fun renderPlanningWarningObj(planningObjects: List<MessagePad.PlanningObject>?) {
|
||||
|
||||
if (planningObjects == null) {
|
||||
Log.d("hy","planningObjects null")
|
||||
if (colorTrafficData.size == 0) {
|
||||
//处于美化模式或者自动驾驶状态下展示
|
||||
if(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || mAutopilotStatus==2){
|
||||
if (planningObjects == null) {
|
||||
Log.d("hy","planningObjects null")
|
||||
if (colorTrafficData.size == 0) {
|
||||
return
|
||||
}
|
||||
colorTrafficData.forEach {
|
||||
val cacheData = mMarkersCaches[it] //todo 是否要直接绘制 还是等下一帧
|
||||
if (cacheData != null) {
|
||||
mMarkersCaches[it] = cacheData.toBuilder().setColor("#D8D8D8FF").build()
|
||||
}
|
||||
}
|
||||
colorTrafficData.clear()
|
||||
return
|
||||
}
|
||||
colorTrafficData.forEach {
|
||||
val cacheData = mMarkersCaches[it] //todo 是否要直接绘制 还是等下一帧
|
||||
if (cacheData != null) {
|
||||
mMarkersCaches[it] = cacheData.toBuilder().setColor("#D8D8D8FF").build()
|
||||
}
|
||||
}
|
||||
colorTrafficData.clear()
|
||||
return
|
||||
}
|
||||
val tempTrafficData = ArrayList<TrackedObject>()
|
||||
val tempTrafficData = ArrayList<TrackedObject>()
|
||||
|
||||
// //todo test code 用于模拟感知物
|
||||
// mMarkersCaches["67025"] = obj
|
||||
// mMarkersCaches["3124"] = obj1
|
||||
// mMarkersCaches["12"] = obj2
|
||||
// mMarkersCaches["67025"] = obj
|
||||
// mMarkersCaches["3124"] = obj1
|
||||
// mMarkersCaches["12"] = obj2
|
||||
|
||||
mMarkersCaches.forEach { (uuid, data) ->
|
||||
var temp = data
|
||||
planningObjects.forEach {
|
||||
val trackId = it.uuid.toString()
|
||||
if(uuid == trackId){
|
||||
colorTrafficData.add(trackId)
|
||||
temp = data.toBuilder().setColor("#FFBCB239").build()
|
||||
mMarkersCaches.forEach { (uuid, data) ->
|
||||
var temp = data
|
||||
planningObjects.forEach {
|
||||
val trackId = it.uuid.toString()
|
||||
if(uuid == trackId){
|
||||
colorTrafficData.add(trackId)
|
||||
temp = data.toBuilder().setColor("#FFBCB239").build()
|
||||
}
|
||||
}
|
||||
tempTrafficData.add(temp)
|
||||
}
|
||||
tempTrafficData.add(temp)
|
||||
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.updateBatchMarkerPosition(tempTrafficData)
|
||||
}
|
||||
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.updateBatchMarkerPosition(tempTrafficData)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,4 +188,8 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
trafficDataUuidList.clear()
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
mAutopilotStatus = autoPilotStatusInfo.state
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user