Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better for loops, part 3/N #3556

Merged
merged 8 commits into from
Jan 16, 2020
Prev Previous commit
Next Next commit
our_cvfh.hpp: Code improvement via auto and modern for loops
  • Loading branch information
kunaltyagi committed Jan 16, 2020
commit 43f7d6e76e97d8fa1a8c63d18abab294f964454e
8 changes: 4 additions & 4 deletions features/include/pcl/features/impl/our_cvfh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ pcl::OURCVFHEstimation<PointInT, PointNT, PointOutT>::sgurf (Eigen::Vector3f & c
s_xplus = s_xminus = s_yplus = s_yminus = 0.f;

//disambiguate rf using all points
for (int k = 0; k < static_cast<int> (grid->points.size ()); k++)
for (const auto& point: grid->points)
{
Eigen::Vector3f pvector = grid->points[k].getVector3fMap ();
Eigen::Vector3f pvector = point.getVector3fMap ();
float dist_x, dist_y;
dist_x = std::abs (evx.dot (pvector));
dist_y = std::abs (evy.dot (pvector));
Expand Down Expand Up @@ -419,9 +419,9 @@ pcl::OURCVFHEstimation<PointInT, PointNT, PointOutT>::computeRFAndShapeDistribut
float sigma = 0.01f; //1cm
float sigma_sq = sigma * sigma;

for (int k = 0; k < static_cast<int> (grid->points.size ()); k++)
for (const auto& point: grid->points)
{
Eigen::Vector4f p = grid->points[k].getVector4fMap ();
Eigen::Vector4f p = point.getVector4fMap ();
p[3] = 0.f;
float d = p.norm ();

Expand Down