@@ -172,10 +172,56 @@ ros2 run cloudini_ros test_direct_publisher --ros-args \
172172# Convert a bare .mcap file (if sibling metadata.yaml exists, it is also transformed)
173173./build_release/tools/cloudini_rosbag_converter -c -y -f DATA/my_bag/my_bag_0.mcap
174174
175+ # Convert with --viz: visualization-oriented lossy preprocessing
176+ # (drop NaN points, voxel-dedupe at xyz resolution, quantize FLOAT64 to 1us).
177+ # Roughly halves output size on real LIDAR with stage-2 ZSTD.
178+ ./build_release/tools/cloudini_rosbag_converter -c -y --viz -f DATA/my_bag/
179+
175180# Decode back to PointCloud2
176181./build_release/tools/cloudini_rosbag_converter -d -y -f DATA/my_bag_encoded/
177182```
178183
184+ ** Visualization workflow (` --viz ` )** :
185+
186+ The ` --viz ` flag bundles three lossy preprocessing operations applied per
187+ message before V4 encoding:
188+ 1 . Drop points whose geometry triple (xyz) contains NaN/inf.
189+ 2 . Voxel-dedupe at the xyz resolution (default 1mm). Hash-based,
190+ order-preserving — first occurrence of each voxel wins.
191+ 3 . Quantize FLOAT64 fields without an explicit resolution to 1µs (typically
192+ per-point timestamps stored as seconds-since-epoch).
193+
194+ The wire format produced is plain V4 — any standard ` mcap ` / ROS2 consumer
195+ reads it without changes. The flag is for compression workflows where the
196+ original NaN/duplicate/sub-µs-precision data isn't needed by downstream
197+ visualizers. Empirical results on real LIDAR bags: ratio drops from ~ 30-40%
198+ (V4 lossless) to ~ 13-30% codec-only, ~ 15-17% after stage-2 ZSTD.
199+
200+ Implementation: ` cloudini_ros::applyVizLossyPreprocessing ` in
201+ ` cloudini_lib/src/ros_msg_utils.cpp ` . Public API in ` ros_msg_utils.hpp ` .
202+
203+ ** Codec benchmark** :
204+ ``` bash
205+ # Per-topic ratio + encode/decode speed for V4 vs V4+viz
206+ ./build_release/tools/mcap_codec_benchmark DATA/my_bag.mcap --max-messages 100
207+
208+ # Add --zstd for after-ZSTD-3 sizes (production-equivalent)
209+ ./build_release/tools/mcap_codec_benchmark DATA/my_bag.mcap --max-messages 100 --zstd
210+
211+ # --explain prints field schema + viz-preprocessing effect for the first
212+ # message of each topic (NaN count, dedup count, FLOAT64 fields quantized)
213+ ./build_release/tools/mcap_codec_benchmark DATA/my_bag.mcap --explain
214+ ```
215+
216+ ** V5 naming note** : A previous research branch
217+ (` feat/lossy-v2-bitpacked-default ` , git tag ` v5-reference-2026-05 ` ) used "V5"
218+ for a GPU-decodable bit-packed format. That format is archived and should not
219+ be confused with the current V5 wire version on this branch. Current V5 keeps
220+ the V4 float paths and adds adaptive integer sections per chunk: integer fields
221+ can choose V4 delta-varint, palette indexes, raw-value RLE, or Delta-RLE
222+ for repeated increments. Use
223+ ` mcap_codec_benchmark ` to compare V4/V5 and V4-viz/V5-viz.
224+
179225### Debugging with ROS2 CLI
180226
181227``` bash
0 commit comments