Skip to content

Added reserve function before storing points in PointCloud in VoxelGr…#4938

Merged
mvieth merged 2 commits intoPointCloudLibrary:masterfrom
KotaYonezawa:voxelgridcov.getDisplayCloud
Sep 25, 2021
Merged

Added reserve function before storing points in PointCloud in VoxelGr…#4938
mvieth merged 2 commits intoPointCloudLibrary:masterfrom
KotaYonezawa:voxelgridcov.getDisplayCloud

Conversation

@KotaYonezawa
Copy link
Copy Markdown
Contributor

Added reserve function before storing points in PointCloud in VoxelGridCovariance::getDisplayCloud. (#4931)

mvieth
mvieth previously approved these changes Sep 8, 2021
Copy link
Copy Markdown
Member

@mvieth mvieth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

kunaltyagi
kunaltyagi previously approved these changes Sep 23, 2021
Copy link
Copy Markdown
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor point. LGTM otherwise

Thanks @KotaYonezawa san

Eigen::Vector3d rand_point;
Eigen::Vector3d dist_point;

cell_cloud.reserve (pnt_per_cell * std::count_if (leaves_.begin (), leaves_.end (), [this] (auto& l) { return (l.second.nr_points >= min_points_per_voxel_); }));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we break this in 2 lines?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your comment.
I'm not so sure about PCL coding rule but is following fine?

  cell_cloud.reserve (pnt_per_cell * std::count_if (leaves_.begin (), leaves_.end (),
      [this] (auto& l) { return (l.second.nr_points >= min_points_per_voxel_); }));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@KotaYonezawa KotaYonezawa dismissed stale reviews from kunaltyagi and mvieth via f3cef13 September 24, 2021 08:33
@mvieth
Copy link
Copy Markdown
Member

mvieth commented Sep 24, 2021

Closing and reopening to trigger CI ... it somehow didn't run after your last commit

@mvieth mvieth closed this Sep 24, 2021
@mvieth mvieth reopened this Sep 24, 2021
@mvieth mvieth merged commit 1ec2f12 into PointCloudLibrary:master Sep 25, 2021
@mvieth mvieth added the changelog: enhancement Meta-information for changelog generation label Oct 16, 2021
mvieth pushed a commit to mvieth/pcl that referenced this pull request Dec 27, 2021
PointCloudLibrary#4938)

* Added reserve function before storing points in PointCloud in VoxelGridCovariance::getDisplayCloud. (PointCloudLibrary#4931)

* Break in 2 lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Meta-information for changelog generation module: filters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Filters] PointCloud::reserve should be added in VoxelGridCovariance::getDisplayCloud

4 participants