fix: intensities error - #6
Open
jmnavarrete wants to merge 3 commits into
Open
Conversation
RomanRobotnik
approved these changes
Mar 17, 2026
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.
This pull request enhances the flexibility and robustness of the
pointcloud_to_laserscannodelet by allowing configurable handling of the intensity field in incoming point clouds. The main improvements are the introduction of a parameter for specifying the intensity field name, safer processing when the field is missing, and clearer code structure for point cloud iteration.Configurable intensity field support
Added a new ROS parameter
intensity_field_nameto allow users to specify which field in the point cloud should be used for intensity values, making the nodelet compatible with different point cloud formats. (src/pointcloud_to_laserscan_nodelet.cpp,include/pointcloud_to_laserscan/pointcloud_to_laserscan_nodelet.h) [1] [2]Implemented a helper function
hasFieldto check for the presence of the specified intensity field in the incoming point cloud, improving robustness and error handling. (src/pointcloud_to_laserscan_nodelet.cpp)Robust handling of missing intensity field
0.0and issue a warning if the specified intensity field is not found, ensuring the nodelet continues to function even with incomplete data. (src/pointcloud_to_laserscan_nodelet.cpp) [1] [2]Code clarity and maintainability
Refactored the point cloud iteration in
cloudCbto separate cases for when the intensity field is present and absent, improving code readability and maintainability. (src/pointcloud_to_laserscan_nodelet.cpp) [1] [2]Minor formatting improvements for debug messages to enhance log clarity. (
src/pointcloud_to_laserscan_nodelet.cpp)