A、默认开启点云绘制

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-08-29 15:26:18 +08:00
parent e6c0553a62
commit 894654ddf1
3 changed files with 29 additions and 26 deletions

View File

@@ -973,7 +973,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
/*—————————————作为司机端———————————*/
int mode = Constants.getIpcConnectionMode(this);
Set<MessageType> messageTypes = new HashSet<>();
messageTypes.add(MessageType.TYPE_RECEIVE_POINT_CLOUD);
// 注释掉下面代码,默认开启点云订阅
//messageTypes.add(MessageType.TYPE_RECEIVE_POINT_CLOUD);
SubscribeInterfaceOptions subscribeInterfaceOptions = SubscribeInterfaceOptions.newBuilder()
.setRole(com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DEBUG)
.setType(com.zhidao.support.adas.high.common.Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE)

View File

@@ -3,7 +3,6 @@ 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
@@ -43,32 +42,35 @@ class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAuto
}
override fun onAutopilotPointCloudDataUpdate(pointCloud: ByteArray?) {
// 根据配置动态控制点云是否绘制
if (FunctionBuildConfig.isDrawPointCloudData) {
if (!isDrawPointCloud) {
Logger.d(TAG, "====开启点云渲染====")
isDrawPointCloud = true
try {// 根据配置动态控制点云是否绘制
if (FunctionBuildConfig.isDrawPointCloudData) {
if (!isDrawPointCloud) {
Logger.d(TAG, "====开启点云渲染====")
isDrawPointCloud = true
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
}
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
}
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
/**
* 更新点云数据
* @param dataStr 点云数据
* @param isTrasformer 是否需要转换坐标
* @param isResidual 是否需要差量更新
* @param isStrong 是否加粗显示
* @return 是否执行
*/
Logger.d(TAG, "====开始传入地图点云数据====")
val result = PointCloudHelper.updatePointCloudDataByPb(pointCloud, true, false, false)
Logger.d(TAG, "====结束传入地图点云数据=====$result")
} else {
if (isDrawPointCloud) {
Logger.d(TAG, "====停止点云绘制====")
isDrawPointCloud = false
PointCloudHelper.setIsDrawPointCloud(false)//停止点云绘制
/**
* 更新点云数据
* @param dataStr 点云数据
* @param isTrasformer 是否需要转换坐标
* @param isResidual 是否需要差量更新
* @param isStrong 是否加粗显示
* @return 是否执行
*/
Logger.d(TAG, "====开始传入地图点云数据====")
val result = PointCloudHelper.updatePointCloudDataByPb(pointCloud, true, false, false)
Logger.d(TAG, "====结束传入地图点云数据=====$result")
} else {
if (isDrawPointCloud) {
Logger.d(TAG, "====停止点云绘制====")
isDrawPointCloud = false
PointCloudHelper.setIsDrawPointCloud(false)//停止点云绘制
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}

View File

@@ -120,7 +120,7 @@ object FunctionBuildConfig {
*/
@Volatile
@JvmField
var isDrawPointCloudData = false
var isDrawPointCloudData = true
/**
* 地图是否忽略判断条件直接绘制工控机引导线数据&全局路径规划