Skip to content

fix: intensities error - #6

Open
jmnavarrete wants to merge 3 commits into
rosfrom
fix/ros-intensities-error
Open

fix: intensities error#6
jmnavarrete wants to merge 3 commits into
rosfrom
fix/ros-intensities-error

Conversation

@jmnavarrete

Copy link
Copy Markdown

This pull request enhances the flexibility and robustness of the pointcloud_to_laserscan nodelet 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_name to 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 hasField to 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

  • Added logic to use a default intensity value of 0.0 and 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 cloudCb to 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)

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.

3 participants