[change]更换点云PB

This commit is contained in:
xinfengkun
2022-06-01 13:02:31 +08:00
parent efa5295360
commit f521f46cc0
11 changed files with 23 additions and 22 deletions

View File

@@ -3,11 +3,12 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import mogo.telematics.pad.MessagePad;
import rule_segement.MogoPointCloudOuterClass;
public class MyPointCloud extends BaseInfo {
public final rule_segement.PointCloud.LidarPointCloud bean;
public final MogoPointCloudOuterClass.MogoPointCloud bean;
public MyPointCloud(MessagePad.Header header, rule_segement.PointCloud.LidarPointCloud bean) {
public MyPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud bean) {
super("接收", bean.getSerializedSize(), header);
this.bean = bean;
}

View File

@@ -96,7 +96,7 @@ import mogo_msg.MogoReportMsg;
import perception.TrafficLightOuterClass;
import prediction.Prediction;
import record_cache.RecordPanelOuterClass;
import rule_segement.PointCloud;
import rule_segement.MogoPointCloudOuterClass;
public class MainActivity extends BaseActivity implements OnAdasListener, OnAdasConnectStatusListener, BaseAdapter.OnItemClickListener<String> {
private final static String TAG = MainActivity.class.getSimpleName();
@@ -276,7 +276,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
public void onClick(View v) {
// MessagePad.Header header = MessagePad.Header.newBuilder()
// .setTimestamp(1.6523361438761907E9).build();
// PointCloud.LidarPointCloud pointCloud = PointCloud.LidarPointCloud.newBuilder()
// MogoPointCloudOuterClass.MogoPointCloud pointCloud = MogoPointCloudOuterClass.MogoPointCloud.newBuilder()
// .setSelfLongitude(112.57563687979261)
// .setSelfLatitude(26.828128487326854)
// .setSelfAltitude(52.89)
@@ -869,7 +869,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onPointCloud(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud) {
public void onPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud pointCloud) {
MyPointCloud base = new MyPointCloud(header, pointCloud);
DataDistribution.getInstance().addData(base);
// String data = PointCloudDecoder.decode(header, pointCloud);

View File

@@ -51,7 +51,7 @@ import mogo_msg.MogoReportMsg
import perception.TrafficLightOuterClass
import prediction.Prediction
import record_cache.RecordPanelOuterClass
import rule_segement.PointCloud
import rule_segement.MogoPointCloudOuterClass
/**
* @author emArrow
@@ -243,7 +243,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
//他车轨迹预测
}
override fun onPointCloud(header: MessagePad.Header?, pointCloud: PointCloud.LidarPointCloud?) {
override fun onPointCloud(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
//点云数据透传
//Logger.d("pointCloud","pointCloud"+pointCloud);
CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(header,pointCloud)

View File

@@ -7,7 +7,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudList
import com.zhidao.support.adas.high.common.PointCloudDecoder
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
import mogo.telematics.pad.MessagePad
import rule_segement.PointCloud
import rule_segement.MogoPointCloudOuterClass
/**
* 订阅点云数据
@@ -38,7 +38,7 @@ class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAuto
CallerAutopilotPointCloudListenerManager.removeListener(TAG)
}
override fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: PointCloud.LidarPointCloud?) {
override fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
// 根据配置动态控制点云是否绘制
if (FunctionBuildConfig.isDrawPointCloudData) {
val data = PointCloudDecoder.decode(header, pointCloud)

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.api.autopilot
import mogo.telematics.pad.MessagePad
import rule_segement.PointCloud
import rule_segement.MogoPointCloudOuterClass
/**
* @author xiaoyuzhou
@@ -15,6 +15,6 @@ interface IMoGoAutopilotPointCloudListener {
*
* @param pointCloud 点云数据
*/
fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: PointCloud.LidarPointCloud?)
fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?)
}

View File

@@ -6,7 +6,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListen
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
import rule_segement.PointCloud
import rule_segement.MogoPointCloudOuterClass
import java.util.concurrent.ConcurrentHashMap
/**
@@ -62,7 +62,7 @@ object CallerAutopilotPointCloudListenerManager : CallerBase() {
* 识别交通元素数据发生更新 回调
*/
@Synchronized
fun invokeAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: PointCloud.LidarPointCloud?) {
fun invokeAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
val tag = it.key
val listener = it.value

View File

@@ -280,7 +280,7 @@ message Warn
// message definition for MsgTypeArrivalNotification
message ArrivalNotification
{
uint32 carType = 1;
uint32 carType = 1; //deserted
Location endLocation = 2;
}
@@ -292,7 +292,7 @@ enum SystemCmdType {
message SystemCmdReq
{
SystemCmdType cmdType = 1; //
SystemCmdType cmdType = 1;
}

View File

@@ -3,7 +3,7 @@ package rule_segement;
import "header.proto";
message LidarPointCloud
message MogoPointCloud
{
optional common.Header header = 1;
optional double self_longitude = 2;

View File

@@ -8,7 +8,7 @@ import mogo_msg.MogoReportMsg;
import perception.TrafficLightOuterClass;
import prediction.Prediction;
import record_cache.RecordPanelOuterClass;
import rule_segement.PointCloud;
import rule_segement.MogoPointCloudOuterClass;
/**
* @ProjectName: lib-adas-fpga
@@ -94,7 +94,7 @@ public interface OnAdasListener {
* @param header 头
* @param pointCloud 数据
*/
void onPointCloud(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud);
void onPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud pointCloud);
/**
* 自动驾驶设备基础信息请求

View File

@@ -1,7 +1,7 @@
package com.zhidao.support.adas.high.common;
import mogo.telematics.pad.MessagePad;
import rule_segement.PointCloud;
import rule_segement.MogoPointCloudOuterClass;
/**
* 点云数据解码器
@@ -17,7 +17,7 @@ public class PointCloudDecoder {
*/
private static final int NUMBER_OF_DATA = 5;
public static String decode(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud) {
public static String decode(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud pointCloud) {
StringBuilder builder = new StringBuilder();
builder.append(((long) header.getTimestamp() * 1000.0D)).append(",");
double d;

View File

@@ -5,7 +5,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.protocol.RawData;
import rule_segement.PointCloud;
import rule_segement.MogoPointCloudOuterClass;
/**
* 透传点云数据
@@ -14,7 +14,7 @@ public class PointCloudMessage extends MyAbstractMessageHandler {
@Override
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
PointCloud.LidarPointCloud pointCloud = PointCloud.LidarPointCloud.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
MogoPointCloudOuterClass.MogoPointCloud pointCloud = MogoPointCloudOuterClass.MogoPointCloud.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
if (adasListener != null) {
adasListener.onPointCloud(raw.getHeader(), pointCloud);
}