[change]点云解析增加id

This commit is contained in:
xinfengkun
2022-05-16 18:19:01 +08:00
parent b5d1d52405
commit 7c01c637e4

View File

@@ -9,14 +9,13 @@ import rule_segement.PointCloud;
* 如果add_data 没有数据 新增数据大小用-1表示
* 如果del_data 没有数据 删除数据大小用-2表示
* 如果又不存在的数会使用0.0补位
* 目前工控机所发送数据没用ID 所以默认用0代替
*/
public class PointCloudDecoder {
/**
* add 和del 列表中 多少一个数据为一组
* 目前缺少id所以是4
* 顺序是idx,y,z,强度 5
*/
private static final int NUMBER_OF_DATA = 4;
private static final int NUMBER_OF_DATA = 5;
public static String decode(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud) {
StringBuilder builder = new StringBuilder();
@@ -70,7 +69,7 @@ public class PointCloudDecoder {
int temp = i * NUMBER_OF_DATA;
if (i < addSize) {
//目前没有id 默认插入0
add.append(0).append(",");
add.append(pointCloud.getAddData(temp++)).append(",");
add.append(pointCloud.getAddData(temp++)).append(",");
add.append(pointCloud.getAddData(temp++)).append(",");
add.append(pointCloud.getAddData(temp++)).append(",");
@@ -78,8 +77,7 @@ public class PointCloudDecoder {
}
if (i < delSize) {
temp = i * NUMBER_OF_DATA;
//目前没有id 默认插入0
del.append(0).append(",");
del.append(pointCloud.getDelData(temp++)).append(",");
del.append(pointCloud.getDelData(temp++)).append(",");
del.append(pointCloud.getDelData(temp++)).append(",");
del.append(pointCloud.getDelData(temp++)).append(",");