From ef97e0e5bf836d70548994c6944d53a6549cb681 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 18 Jul 2022 11:02:47 +0800 Subject: [PATCH] =?UTF-8?q?[Change]=201=E3=80=81=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E9=AB=98=E7=B2=BE=E5=9C=B0=E5=9B=BE=E6=89=93=E5=BC=80=E7=82=B9?= =?UTF-8?q?=E4=BA=91=202=E3=80=81=E5=A2=9E=E5=8A=A0=E7=82=B9=E4=BA=91?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../autopilot/adapter/MoGoAdasListenerImpl.kt | 1 + .../function/map/MapPointCloudSubscriber.kt | 20 +++++++++-- .../core/data/config/FunctionBuildConfig.kt | 2 +- .../IMoGoAutopilotPointCloudListener.kt | 8 +++++ ...allerAutopilotPointCloudListenerManager.kt | 36 +++++++++++++------ gradle.properties | 2 +- .../java/com/mogo/map/AMapViewWrapper.java | 1 + 7 files changed, 55 insertions(+), 15 deletions(-) diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt index 0e1d2caf80..c11cdfdef3 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -249,6 +249,7 @@ class MoGoAdasListenerImpl : OnAdasListener { override fun onPointCloud(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) { //点云数据透传 //Logger.d("pointCloud","pointCloud"+pointCloud); + CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(header, pointCloud) } override fun onPointCloud(pointCloud: ByteArray?) { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt index afbd0d4893..01589af8b7 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt @@ -3,9 +3,13 @@ package com.mogo.eagle.core.function.map import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListener import com.mogo.eagle.core.function.api.base.IMoGoSubscriber +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.zhidaoauto.map.sdk.open.business.PointCloudHelper +import mogo.telematics.pad.MessagePad +import rule_segement.MogoPointCloudOuterClass +import java.math.BigDecimal /** * 订阅点云数据 @@ -56,9 +60,9 @@ class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAuto * @param isStrong 是否加粗显示 * @return 是否执行 */ - Logger.d(TAG, "====开始传入地图点云数据====") + //Logger.d(TAG, "====开始传入地图点云数据====") val result = PointCloudHelper.updatePointCloudDataByPb(pointCloud, false, true, true) - Logger.d(TAG, "====结束传入地图点云数据=====$result") + //Logger.d(TAG, "====结束传入地图点云数据=====$result") } else { if (isDrawPointCloud) { Logger.d(TAG, "====停止点云绘制====") @@ -67,4 +71,16 @@ class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAuto } } } + + override fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) { +// Logger.d(TAG, "数据对比:" +// + "\n自车定位:自车的 satelliteTime==${getPrettyNumber(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().satelliteTime.toString())} 经纬度:${CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().locationLat},${CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().locationLon}" +// + "\n点云数据:点云的 header?.timestamp==${getPrettyNumber(header?.timestamp.toString())} 经纬度:${pointCloud?.selfLatitude},${pointCloud?.selfLongitude} 点云数量:addDataCount==${pointCloud?.addDataCount} delDataCount===${pointCloud?.delDataCount} " +// ) + } + + fun getPrettyNumber(number: String): String { + return BigDecimal.valueOf(number.toDouble()) + .stripTrailingZeros().toPlainString() + } } \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt index 1a26d2f71c..246e98253c 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt @@ -95,7 +95,7 @@ object FunctionBuildConfig { */ @Volatile @JvmField - var isDrawPointCloudData = false + var isDrawPointCloudData = true /** * 地图是否忽略判断条件直接绘制工控机引导线数据&全局路径规划 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotPointCloudListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotPointCloudListener.kt index 6bddda52bf..8c4e0776a0 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotPointCloudListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotPointCloudListener.kt @@ -1,5 +1,8 @@ package com.mogo.eagle.core.function.api.autopilot +import mogo.telematics.pad.MessagePad +import rule_segement.MogoPointCloudOuterClass + /** * @author xiaoyuzhou @@ -15,4 +18,9 @@ interface IMoGoAutopilotPointCloudListener { */ fun onAutopilotPointCloudDataUpdate(pointCloud: ByteArray?) + /** + * + */ + fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotPointCloudListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotPointCloudListenerManager.kt index 60042117c5..798aba4b33 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotPointCloudListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotPointCloudListenerManager.kt @@ -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 = + private val M_POINT_CLOUD_LISTENERS: ConcurrentHashMap = 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) + } + } + } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1efc15bb8b..18d72223d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -82,7 +82,7 @@ MOGO_LOCATION_VERSION=1.4.3.7 MOGO_TELEMATIC_VERSION=1.4.3.7 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.3.0.10 +MAP_SDK_VERSION=2.3.0.11 MAP_SDK_OPERATION_VERSION=1.0.13 # websocket WEBSOCKET_VERSION=1.1.7 diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java index 4f682ea3d5..8b81be36ff 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java @@ -988,6 +988,7 @@ public class AMapViewWrapper implements IMogoMapView, bean.setLon(gnssInfo.getLongitude()); bean.setLat(gnssInfo.getLatitude()); bean.setGnss_speed(((float) gnssInfo.getGnssSpeed())); + bean.setReceiverDataTime(System.currentTimeMillis()); // 使用外部定位数据修改自车位置 mMapView.getLocationClient().updateRTKAutoPilotLocation(bean); CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getContext()).updateLocation(bean);