Repository navigation
refactor(point-types): store intensity as float in all output point types - #94
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
intensityfield type fromstd::uint8_ttofloatin all three output point types:PointXYZI,PointXYZIT,PointEnXYZIT(point_types.hpp).lround+uint8_tcast inSeyondPCDDecoder::point_xyz_data_parse; the clamped float value is written directly topoint.intensity.docs/seyond_intensity_scaling.mdto describeintensityasfloat32.Robin W intensity scaling (
× 255/4095for major ≤ 3,× 255/255for 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.fieldswill reportintensitywithdatatype = FLOAT32(7) instead ofUINT8(2). Downstream consumers that assumeuint8will need to read the field asfloat32.Test plan
colcon build --packages-select bag_convertersucceeds (no new warnings/errors).bag_converter --helpruns.intensityasFLOAT32with values in[0, 255].uint8rounding (within rounding tolerance).scripts/plot_field_distribution.pyon Robin W and non-Robin W bags.