facontidavide / pointcloud_compression

Apache License 2.0
28 stars 2 forks source link

Experimental software to benchmark PCL compression

Lossy compression for pointclouds generated by LIDARs. It preserves the number of points and their order.

It does not use voxelization.

Vanilla lossless ZSTD and LZ4 compression are added for reference.

Work in progress. Nevertheless, YOU can help.

Run this app on an existing rosbag containing a sensors_msgs/PointCloud2 message generated by a LIDAR.

In Releases, you should find an AppImage that can run directly in Ubuntu 22.04.

Motivation

PointCloud messages in ROS are usually very large.

This means that rosbags containing point clouds tend to be very large and streaming these messages over wireless network can be slow or prohibitive.

Our friend (or foe?) DDS doesn't make things any easier (on the contrary).

Google Draco provides an effective way to compress point clouds, but its KD-tree based algorithm will change the order and number of points in the cloud.

Unfortunately, some algorithms, being LOAM (Lidar odometry) a notable example, use hard-coded assumptions about the order of the points, for instance, to calculate corners or flat surfaces.

My codec tries to preserve the original point cloud order and keep compression time as short as possible.

How to run

The first command line argument is the path to the rosbag.

Expected output (example):

Topic: /pandar_xt_32_0_lidar
  Count: 100
  [LZ4]          ratio: 0.529 time (usec): 2533
  [ZSTD]         ratio: 0.474 time (usec): 5412
  [Lossy only ]  ratio: 0.393 time (usec): 1716
  [Lossy + LZ4]  ratio: 0.234 time (usec): 2869
  [Lossy + ZSTD] ratio: 0.200 time (usec): 4006

About the Lossy compression

A quantization of 1mm is applied to the X, Y, Z channels. All the other channels have no loss in accuracy.