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

Transform classic loops to range-based for loops in module people #2849

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions people/apps/main_ground_based_people_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ int main (int argc, char** argv)
pcl::visualization::PointCloudColorHandlerRGBField<PointT> rgb(cloud);
viewer.addPointCloud<PointT> (cloud, rgb, "input_cloud");
unsigned int k = 0;
for(std::vector<pcl::people::PersonCluster<PointT> >::iterator it = clusters.begin(); it != clusters.end(); ++it)
for(auto &cluster : clusters)
{
if(it->getPersonConfidence() > min_confidence) // draw only people with confidence above a threshold
if(cluster.getPersonConfidence() > min_confidence) // draw only people with confidence above a threshold
{
// draw theoretical person bounding box in the PCL viewer:
it->drawTBoundingBox(viewer, k);
cluster.drawTBoundingBox(viewer, k);
k++;
}
}
Expand Down
10 changes: 5 additions & 5 deletions people/include/pcl/people/impl/head_based_subcluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ pcl::people::HeadBasedSubclustering<PointT>::mergeClustersCloseInFloorCoordinate
// Copy cluster points into new cluster:
pcl::PointIndices point_indices;
point_indices = input_clusters[i].getIndices();
for(size_t j = 0; j < connected_clusters[i].size(); j++)
for(const int &cluster : connected_clusters[i])
{
if (!used_clusters[connected_clusters[i][j]]) // if this cluster has not been used yet
if (!used_clusters[cluster]) // if this cluster has not been used yet
{
used_clusters[connected_clusters[i][j]] = true;
for(std::vector<int>::const_iterator points_iterator = input_clusters[connected_clusters[i][j]].getIndices().indices.begin();
points_iterator != input_clusters[connected_clusters[i][j]].getIndices().indices.end(); points_iterator++)
used_clusters[cluster] = true;
for(std::vector<int>::const_iterator points_iterator = input_clusters[cluster].getIndices().indices.begin();
points_iterator != input_clusters[cluster].getIndices().indices.end(); points_iterator++)
{
point_indices.indices.push_back(*points_iterator);
}
Expand Down