Function cloudini_ros::applyVizLossyPreprocessing
Defined in File ros_msg_utils.hpp
Function Documentation
-
void cloudini_ros::applyVizLossyPreprocessing(RosPointCloud2 &pc_info)
Visualization-oriented lossy preprocessing applied in place.
Bundles three lossy operations that approximately halve output size on real LIDAR after stage-2 ZSTD, while preserving every declared field:
NaN drop. Points whose geometry triple (xyz) contains NaN/inf are removed.
Voxel dedup (1mm resolution by default — uses xyz fields’ resolution). Hash-based, order-preserving: first occurrence of each voxel wins.
1µs FLOAT64 quantization. Every FLOAT64 field whose
resolutionis unset getsresolution = 1e-6so the encoder routes it through FieldEncoderFloat_Lossy (quantize+varint) instead of Gorilla. Affects typically per-pointtimestamp/timefields stored as seconds-since-epoch FLOAT64.
Modifies pc_info in place: rewrites pc_info.owned_data with the cleaned point bytes, points pc_info.data at it, updates pc_info.width to the new point count, and sets resolution=1µs on FLOAT64 fields without one.
No-op if pc_info has no geometry triple. The triple is detected structurally (first 3 FLOAT32 fields with shared resolution and consecutive offsets {b, b+4, b+8}); the field names are never read.