File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
filters/include/pcl/filters/impl Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -408,11 +408,17 @@ pcl::VoxelGrid<PointT>::applyFilter (PointCloud &output)
408
408
{
409
409
Eigen::Vector4f centroid (Eigen::Vector4f::Zero ());
410
410
411
- for (unsigned int li = first_index; li < last_index; ++li)
412
- centroid += input_->points [index_vector[li].cloud_point_index ].getVector4fMap ();
411
+ for (unsigned int li = first_index; li < last_index; ++li)
412
+ {
413
+ centroid[0 ] += input_->points [index_vector[li].cloud_point_index ].x ;
414
+ centroid[1 ] += input_->points [index_vector[li].cloud_point_index ].y ;
415
+ centroid[2 ] += input_->points [index_vector[li].cloud_point_index ].z ;
416
+ }
413
417
414
418
centroid /= static_cast <float > (last_index - first_index);
415
- output.points [index].getVector4fMap () = centroid;
419
+ output.points [index].x = centroid[0 ];
420
+ output.points [index].y = centroid[1 ];
421
+ output.points [index].z = centroid[2 ];
416
422
}
417
423
else
418
424
{
You can’t perform that action at this time.
0 commit comments