Skip to content

Add PCD nearest neighbor search demo#1

Open
qiyu-lu wants to merge 2 commits into
scomup:mainfrom
qiyu-lu:nearest-search-pcd-demo
Open

Add PCD nearest neighbor search demo#1
qiyu-lu wants to merge 2 commits into
scomup:mainfrom
qiyu-lu:nearest-search-pcd-demo

Conversation

@qiyu-lu
Copy link
Copy Markdown

@qiyu-lu qiyu-lu commented May 9, 2026

Summary

  • Add a PCD-based nearest-neighbor search demo for likd-tree
  • Visualize the source cloud, query point, nearest point, and connecting line
  • Add brute-force validation and terminal timing output
  • Document the demo usage in README

Test

  • cmake -B build
  • cmake --build build
  • ./build/nearest_search_pcd_demo ./test/pcd/globalMap.pcd 0.9 0.1 0
  • Brute-force check: MATCH

Copilot AI review requested due to automatic review settings May 9, 2026 11:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new PCL/PCD-based nearest-neighbor demo to help users visualize and validate likd-tree queries, and wires it into the build + documentation.

Changes:

  • Add nearest_search_pcd_demo that loads a PCD, builds a KDTree, queries a point, brute-force validates, and optionally visualizes the result.
  • Update CMake to only build the new demo when PCL visualization is available (while still supporting PCL common/io when visualization is missing).
  • Document usage in README.md and update .gitignore.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
test/nearest_search_pcd_demo.cpp New PCD nearest-neighbor demo with optional PCLVisualizer rendering and brute-force validation.
README.md Adds usage docs, example output, and a screenshot for the new demo.
CMakeLists.txt Detects PCL visualization component and conditionally builds/link the new demo.
.gitignore Adds ignores for /.cache/ and test/pcd/*.pcd.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

viewer.setPointCloudRenderingProperties(
pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 12, "nearest");

viewer.addLine<PointType>(query, nearest, 255.0, 255.0, 0.0,
Comment thread README.md
Example:

```bash
./build/nearest_search_pcd_demo ./test/pcd/globalMap.pcd 0.9 0.1 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants