Skip to content

Commit

Permalink
Feature: added test for search and using full list of points with sam…
Browse files Browse the repository at this point in the history
…ple 4 points commented out
  • Loading branch information
awbrown90 committed Mar 29, 2019
1 parent fd3102a commit b650012
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/quiz/cluster/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ int main ()
pcl::visualization::PCLVisualizer::Ptr viewer = initScene(window, 25);

// Create data
//std::vector<std::vector<float>> points = { {-6.2,7}, {-6.3,8.4}, {-5.2,7.1}, {-5.7,6.3}, {7.2,6.1}, {8.0,5.3}, {7.2,7.1}, {0.2,-7.1}, {1.7,-6.9}, {-1.2,-7.2}, {2.2,-8.9} };
std::vector<std::vector<float>> points = { {-6.2,7}, {-6.3,8.4}, {-5.2,7.1}, {-5.7,6.3} };
std::vector<std::vector<float>> points = { {-6.2,7}, {-6.3,8.4}, {-5.2,7.1}, {-5.7,6.3}, {7.2,6.1}, {8.0,5.3}, {7.2,7.1}, {0.2,-7.1}, {1.7,-6.9}, {-1.2,-7.2}, {2.2,-8.9} };
//std::vector<std::vector<float>> points = { {-6.2,7}, {-6.3,8.4}, {-5.2,7.1}, {-5.7,6.3} };
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = CreateData(points);

KdTree* tree = new KdTree;
Expand All @@ -111,6 +111,12 @@ int main ()

int it = 0;
render2DTree(tree->root,viewer,window, it);

std::cout << "Test Search" << std::endl;
std::vector<int> nearby = tree->search({-6,7},3.0);
for(int index : nearby)
std::cout << index << ",";
std::cout << std::endl;

// Time segmentation process
auto startTime = std::chrono::steady_clock::now();
Expand Down

0 comments on commit b650012

Please sign in to comment.