Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | |
| Checkout URI | https://github.com/jlblancoc/nanoflann.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-10-11 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| nanoflann_vendor | 2.0.0 |
README

nanoflann
| Distro | Build dev | Build releases | Stable version |
|---|---|---|---|
| ROS 2 Humble (u22.04) |
|
||
| ROS 2 Jazzy (u24.04) |
|
||
| ROS 2 Kilted (u24.04) |
|
||
| ROS 2 Lyrical (u26.04) |
|
||
| ROS 2 Rolling (u26.04) |
|
(Binary build badges are for amd64 and arm64, respectively)
1. About
nanoflann is a header-only C++ library for building KD-Trees of datasets with different topologies. The Euclidean core (R2, R3, RN point clouds) is C++11; the optional compile-time product-manifold metrics — SO(2), SO(3), SE(2), SE(3), the unit sphere S2/SN, tori, and arbitrary products — require C++17 (see §1.5). It also provides incremental / dynamic KD-tree indices for point clouds that change over time (e.g. sliding-window LiDAR maps). nanoflann returns exact nearest neighbors by default (an optional eps-approximate mode is available via SearchParameters::eps). It does not require compiling or installing: you just need to #include <nanoflann.hpp> in your code.
This library is a fork of the flann library by Marius Muja and David G. Lowe, and born as a child project of MRPT. Following the original license terms, nanoflann is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Citing nanoflann
If you use nanoflann in your research, please cite the following paper (accepted for publication in IEEE RA-L, 2026):
J.L. Blanco-Claraco, “nanoflann: A Header-Only KD-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds,” IEEE Robotics and Automation Letters, 2026 (accepted).
@article{blancoclaraco2026nanoflann,
title = {nanoflann: A Header-Only {KD}-Tree Library for Exact Nearest-Neighbor Search on Compile-Time Product Manifolds},
author = {Blanco-Claraco, Jose Luis},
journal = {IEEE Robotics and Automation Letters},
year = {2026},
note = {Accepted for publication}
}
Citation for the original software release (2014)
```bibtex @misc{blanco2014nanoflann, title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees}, author = {Blanco, Jose Luis and Rai, Pranjal Kumar}, howpublished = {\url{https://github.com/jlblancoc/nanoflann}}, year = {2014} } ```See the release CHANGELOG for a list of project changes.
1.1. Obtaining the code
- Easiest way: clone this GIT repository and take the
include/nanoflann.hppfile for use where you need it. - Debian or Ubuntu (21.04 or newer) users can install it simply with:
$ sudo apt install libnanoflann-dev
- macOS users can install
nanoflannwith Homebrew with:
$ brew install brewsci/science/nanoflann
or
$ brew tap brewsci/science
$ brew install nanoflann
MacPorts users can use:
$ sudo port install nanoflann
- Linux users can also install it with Linuxbrew with:
brew install homebrew/science/nanoflann - List of stable releases. Check out the CHANGELOG
Although nanoflann itself doesn’t have to be compiled, you can build some examples and tests with:
$ sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
$ mkdir build && cd build && cmake ..
$ make && make test
1.2. C++ API reference
-
Browse the Doxygen documentation.
-
Important note: If L2 norms are used, notice that search radius and all passed and returned distances are actually squared distances.
1.3. Code examples
- KD-tree look-up with
knnSearch()andradiusSearch(): pointcloud_kdd_radius.cpp - KD-tree look-up on a point cloud dataset: pointcloud_example.cpp
- KD-tree look-up on a dynamic point cloud dataset (Bentley–Saxe forest): dynamic_pointcloud_example.cpp
File truncated at 100 lines see the full file