Skip to content

Commit

Permalink
fix(voxel_grid_downsample_filter): support no intensity case (autowar…
Browse files Browse the repository at this point in the history
…efoundation#4922)

fix: support for no intensity field

Signed-off-by: atsushi421 <[email protected]>
  • Loading branch information
atsushi421 authored and miursh committed Sep 15, 2023
1 parent b2af8a5 commit f7322de
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ void FasterVoxelGridDownsampleFilter::set_field_offsets(const PointCloud2ConstPt
x_offset_ = input->fields[pcl::getFieldIndex(*input, "x")].offset;
y_offset_ = input->fields[pcl::getFieldIndex(*input, "y")].offset;
z_offset_ = input->fields[pcl::getFieldIndex(*input, "z")].offset;
intensity_offset_ = input->fields[pcl::getFieldIndex(*input, "intensity")].offset;
int intensity_index = pcl::getFieldIndex(*input, "intensity");
if (intensity_index != -1) {
intensity_offset_ = input->fields[intensity_index].offset;
} else {
intensity_offset_ = z_offset_ + sizeof(float);
}
offset_initialized_ = true;
}

Expand Down

0 comments on commit f7322de

Please sign in to comment.