当前位置:网站首页>驱动点云格式修改带来的效率提升
驱动点云格式修改带来的效率提升
2022-08-04 21:25:00 【moneymyone】
驱动点云格式修改带来的效率提升
背景:
原有的自定义点云结构在读取、传输、解码整个时间段耗时非常巨大,因此将点云结构进行升级,提高整体运行时间。
protobuf字段类型介绍
| .proto Type | Notes | C++ Type |
|---|---|---|
| double | double | |
| float | float | |
| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 |
| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 |
| uint32 | Uses variable-length encoding. | uint32 |
| uint64 | Uses variable-length encoding. | uint64 |
| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 |
| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 |
| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 228. | uint32 |
| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 256. | uint64 |
| sfixed32 | Always four bytes. | int32 |
| sfixed64 | Always eight bytes. | int64 |
| bool | bool | |
| string | A string must always contain UTF-8 encoded text. | string |
| bytes | May contain any arbitrary sequence of bytes. | string |
修改前:
message PointXYZI {
optional float x = 1 [default = nan];
optional float y = 2 [default = nan];
optional float z = 3 [default = nan];
optional uint32 intensity = 4 [default = 0];
}
message PointCloud {
repeated PointXYZIT point = 1;
}
修改后:
message PointXYZI2 {
repeate float x_array = 1 [default = nan];
repeate float y_array = 2 [default = nan];
repeate float z_array = 3 [default = nan];
optional bytes intensity_array = 4 [default = 0];
}
message PointCloud {
optional PointXYZI2 point_array = 1;
}
修改点:
- PointXYZI由重复的数据结构,改为重复的点。
意义在于:
- 原本读写需要多次读写这个结构体,现在改为直接一次性存储点,将所有点都存到这个结构体里面。
- 而且将intensity等参数改为bytes,后续解析出来,减少了整体点云包的大小,减少传输时间。
protobuf修改字段为bytes需要考虑一些问题:
- 电脑大序端和小序端的问题;不同系统会不一样,解读出的bytes会不同。如果其他语言调用C++的库,不通过自己的语言解析,能解决问题?
- 多语言兼容问题,解析问题
- 字段对齐问题
目前占用时间分析:

经验:
- 通过减小字段类型,提高传输速率,空间换时间;
- 通过一次性写入替代多次写入,解决时间,这部分节约的时间占大头。
边栏推荐
- How to understand the crawler's Scrapy framework in the simplest and most popular way?
- PCBA scheme design - kitchen voice scale chip scheme
- SPSS-System Clustering Hand Calculation Practice
- PCBA方案设计——厨房语音秤芯片方案
- Android 面试——如何写一个又好又快的日志库?
- LayaBox---TypeScript---结构
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd6 in position 120: invalid continuation byte
- 数电快速入门(四)(组合逻辑电路的分析以及设计的介绍)
- PyTorch Geometric (PyG) 安装教程
- 数电快速入门(二)(复合逻辑运算和逻辑代数的基本定律的介绍)
猜你喜欢

2、字符集-编码-解码

Spss-一元回归实操

经验分享|盘点企业进行知识管理时的困惑类型

Red team kill-free development practice of simulated confrontation

JWT主动校验Token是否过期

DSPE-PEG-Aldehyde, DSPE-PEG-CHO, Phospholipid-Polyethylene Glycol-Aldehyde A hydrophobic 18-carbon phospholipid
![[2022 Hangzhou Electric Power Multi-School 5 1012 Questions Buy Figurines] Application of STL](/img/fe/1dd9418800366ee25067e154936e3b.png)
[2022 Hangzhou Electric Power Multi-School 5 1012 Questions Buy Figurines] Application of STL

Hands-on Deep Learning_NiN

搬走地下空间开发利用“绊脚石” 中地数码取得地下空间透明化技术突破

硬件开发定制全流程解析
随机推荐
Named routes, the role of name in components
unity2D横版游戏教程9-对话框dialog
web漏洞扫描器-awvs
数电快速入门(五)(编码器的介绍以及通用编码器74LS148和74LS147的介绍)
LeetCode: 406. 根据身高重建队列
1319_STM32F103串口BootLoader移植
stm32mp157系统移植 | 移植ST官方5.10内核到小熊派开发板
3、IO流之字节流和字符流
dotnet 通过 WMI 获取系统安装软件
[21天学习挑战赛——内核笔记](二)——设备树基础
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd6 in position 120: invalid continuation byte
Codeforces Round #811 (Div. 3)
命名路由、组件中name的作用
mdk5.14 cannot be burned
boostrap多选PID查找端口 window
[2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path
ini怎么使用? C#教程
LayaBox---TypeScript---结构
AI/ML无线通信
OD-Model【6】:YOLOv2