[Change]
1、升级高精地图打开点云 2、增加点云日志输出 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -3,6 +3,8 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import rule_segement.MogoPointCloudOuterClass
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -13,11 +15,11 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
object CallerAutopilotPointCloudListenerManager : CallerBase() {
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_IDENTIFY_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotPointCloudListener> =
|
||||
private val M_POINT_CLOUD_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotPointCloudListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加 域控制器感知数据 监听
|
||||
* 添加 点云数据 监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
@@ -25,10 +27,10 @@ object CallerAutopilotPointCloudListenerManager : CallerBase() {
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutopilotPointCloudListener
|
||||
) {
|
||||
if (M_AUTOPILOT_IDENTIFY_LISTENERS.containsKey(tag)) {
|
||||
if (M_POINT_CLOUD_LISTENERS.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS[tag] = listener
|
||||
M_POINT_CLOUD_LISTENERS[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,34 +38,46 @@ object CallerAutopilotPointCloudListenerManager : CallerBase() {
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_IDENTIFY_LISTENERS.containsKey(tag)) {
|
||||
if (!M_POINT_CLOUD_LISTENERS.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS.remove(tag)
|
||||
M_POINT_CLOUD_LISTENERS.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* 删除 点云数据 监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoAutopilotPointCloudListener) {
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
|
||||
M_POINT_CLOUD_LISTENERS.forEach {
|
||||
if (it.value == listener) {
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS.remove(it.key)
|
||||
M_POINT_CLOUD_LISTENERS.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别交通元素数据发生更新 回调
|
||||
* 点云数据 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotPointCloudDataUpdate(pointCloud: ByteArray?) {
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
|
||||
M_POINT_CLOUD_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onAutopilotPointCloudDataUpdate(pointCloud)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 点云数据 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
|
||||
M_POINT_CLOUD_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onAutopilotPointCloudDataUpdate(header, pointCloud)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user