当前位置:网站首页>驱动点云格式修改带来的效率提升
驱动点云格式修改带来的效率提升
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++的库,不通过自己的语言解析,能解决问题?
- 多语言兼容问题,解析问题
- 字段对齐问题
目前占用时间分析:
经验:
- 通过减小字段类型,提高传输速率,空间换时间;
- 通过一次性写入替代多次写入,解决时间,这部分节约的时间占大头。
边栏推荐
- PowerCLi 导入License到vCenter 7
- JWT actively checks whether the Token has expired
- Win11如何设置软件快捷方式?
- C#之app.config、exe.config和vshost.exe.config作用区别
- LayaBox---TypeScript---举例
- 数电快速入门(四)(组合逻辑电路的分析以及设计的介绍)
- 【Programming Ideas】
- Common methods of js's new Function()
- AtCoder Beginner Contest 262 D - I Hate Non-integer Number
- bracket matching
猜你喜欢
随机推荐
【1403. 非递增顺序的最小子序列】
Hands-on Deep Learning_NiN
boostrap多选PID查找端口 window
LayaBox---TypeScript---结构
数电快速入门(二)(复合逻辑运算和逻辑代数的基本定律的介绍)
1.读写点云文件
How to understand the crawler's Scrapy framework in the simplest and most popular way?
PyTorch Geometric (PyG) 安装教程
Named routes, the role of name in components
PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning Code Analysis
命名路由、组件中name的作用
动手学深度学习_NiN
deepstream多相机显示布局
开发deepstram的自定义插件,使用gst-dseaxmple插件进行扩充,实现deepstream图像输出前的预处理,实现图像自定义绘制图(精四)
拼多多开放平台订单信息查询接口【pdd.order.basic.list.get订单基础信息列表查询接口(根据成交时间)】代码对接教程
dotnet delete read-only files
PowerCLi batch configuration of NTP
拒绝服务攻击DDoS介绍与防范
proe和creo的区别有哪些
如何将二叉搜索树转化为一个有序的双向链表(原树上修改)