Skip to content

refactor(point-types): store intensity as float in all output point types - #94

Merged
otenim merged 1 commit into
mainfrom
feat/float-intensity
May 19, 2026
Merged

otenim merged 1 commit into
mainfrom
feat/float-intensity

Conversation

@otenim

@otenim otenim commented May 19, 2026

Copy link
Copy Markdown

Summary

  • Change intensity field type from std::uint8_t to float in all three output point types: PointXYZI, PointXYZIT, PointEnXYZIT (point_types.hpp).
  • Drop the lround + uint8_t cast in SeyondPCDDecoder::point_xyz_data_parse; the clamped float value is written directly to point.intensity.
  • Update README and docs/seyond_intensity_scaling.md to describe intensity as float32.

Robin W intensity scaling (× 255/4095 for major ≤ 3, × 255/255 for major ≥ 4) and the [0, 255] clamp are unchanged — only the storage type changes. Values remain in [0, 255] but now retain fractional precision.

Output schema impact

sensor_msgs/PointCloud2.fields will report intensity with datatype = FLOAT32 (7) instead of UINT8 (2). Downstream consumers that assume uint8 will need to read the field as float32.

Test plan

  • colcon build --packages-select bag_converter succeeds (no new warnings/errors).
  • bag_converter --help runs.
  • Run conversion on a representative mcap and verify the output PointCloud2 reports intensity as FLOAT32 with values in [0, 255].
  • Verify Robin W scaling output range/scale matches the previous uint8 rounding (within rounding tolerance).
  • Plot intensity distribution with scripts/plot_field_distribution.py on Robin W and non-Robin W bags.

…ypes

Change intensity field type from std::uint8_t to float in PointXYZI,
PointXYZIT, and PointEnXYZIT so the output PointCloud2 carries a
float32 intensity field instead of uint8. Drop the lround + uint8_t
cast in the Seyond decoder; the clamped float value is written
directly. Robin W intensity scaling is unchanged — only the storage
type changes.
@otenim
otenim merged commit ff6979d into main May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant