From d3472aee4418065deefc2bb9bc1d590f75acd83c Mon Sep 17 00:00:00 2001 From: Danil An Date: Wed, 21 Jan 2026 17:17:26 +0400 Subject: [PATCH 1/3] Add unordered_dense submodule (v4.8.1) - a fast robin hood hash set/map implementation --- .gitmodules | 3 +++ 3rdparty/unordered_dense | 1 + 2 files changed, 4 insertions(+) create mode 160000 3rdparty/unordered_dense diff --git a/.gitmodules b/.gitmodules index 1c676463..47269dfd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -44,3 +44,6 @@ [submodule "3rdparty/tomlplusplus"] path = 3rdparty/tomlplusplus url = https://github.com/marzer/tomlplusplus.git +[submodule "3rdparty/unordered_dense"] + path = 3rdparty/unordered_dense + url = https://github.com/martinus/unordered_dense.git diff --git a/3rdparty/unordered_dense b/3rdparty/unordered_dense new file mode 160000 index 00000000..3234af2c --- /dev/null +++ b/3rdparty/unordered_dense @@ -0,0 +1 @@ +Subproject commit 3234af2c03549bc85656bfd3a86993bf1cd8aef1 From 3bfc8f1eda77dcf1eea494634d267aa57578c025 Mon Sep 17 00:00:00 2001 From: Danil An Date: Wed, 21 Jan 2026 21:10:36 +0400 Subject: [PATCH 2/3] perf: replace std::unordered_map with ankerl::unordered_dense::map for NDT buckets --- CMakeLists.txt | 6 +++++- apps/compare_trajectories/CMakeLists.txt | 1 + apps/concatenate_multi_livox/CMakeLists.txt | 4 +++- apps/lidar_odometry_step_1/CMakeLists.txt | 1 + apps/lidar_odometry_step_1/lidar_odometry_utils.h | 6 ++++-- apps/livox_mid_360_intrinsic_calibration/CMakeLists.txt | 1 + apps/mandeye_mission_recorder_calibration/CMakeLists.txt | 1 + apps/mandeye_raw_data_viewer/CMakeLists.txt | 1 + apps/mandeye_single_session_viewer/CMakeLists.txt | 1 + apps/multi_view_tls_registration/CMakeLists.txt | 1 + 10 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d413617c..848a90c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,7 +353,7 @@ if (BUILD_WITH_BUNDLED_ONETBB) set(TBB_STRICT OFF CACHE BOOL "" FORCE) set(TBBMALLOC_BUILD OFF CACHE BOOL "" FORCE) set(TBB_CPF OFF CACHE BOOL "" FORCE) - + add_subdirectory(${THIRDPARTY_DIRECTORY}/oneTBB) MESSAGE(STATUS "Using bundled oneTBB from: ${THIRDPARTY_DIRECTORY}/oneTBB") else() @@ -362,6 +362,10 @@ else() MESSAGE(STATUS "Found system TBB") endif() +# Add unordered_dense header-only library +add_subdirectory(${THIRDPARTY_DIRECTORY}/unordered_dense) +MESSAGE(STATUS "Using bundled unordered_dense from: ${THIRDPARTY_DIRECTORY}/unordered_dense") + option(PYBIND "Enable pybind11 bindings" OFF) if(PYBIND) message(STATUS "PYBIND is enabled: fetching pybind.") diff --git a/apps/compare_trajectories/CMakeLists.txt b/apps/compare_trajectories/CMakeLists.txt index 33344f8d..a16a137a 100644 --- a/apps/compare_trajectories/CMakeLists.txt +++ b/apps/compare_trajectories/CMakeLists.txt @@ -30,6 +30,7 @@ target_include_directories( target_link_libraries( mandeye_compare_trajectories PRIVATE Fusion + unordered_dense::unordered_dense ${FREEGLUT_LIBRARY} ${OPENGL_gl_LIBRARY} OpenGL::GLU diff --git a/apps/concatenate_multi_livox/CMakeLists.txt b/apps/concatenate_multi_livox/CMakeLists.txt index 91c0fd35..b59c6567 100644 --- a/apps/concatenate_multi_livox/CMakeLists.txt +++ b/apps/concatenate_multi_livox/CMakeLists.txt @@ -23,7 +23,9 @@ target_include_directories( ${THIRDPARTY_DIRECTORY}/Fusion/Fusion ${FREEGLUT_INCLUDE_DIR}) -target_link_libraries(concatenate_multi_livox PRIVATE core ${PLATFORM_LASZIP_LIB} +target_link_libraries(concatenate_multi_livox PRIVATE core + unordered_dense::unordered_dense + ${PLATFORM_LASZIP_LIB} ${PLATFORM_MISCELLANEOUS_LIBS}) if(WIN32) diff --git a/apps/lidar_odometry_step_1/CMakeLists.txt b/apps/lidar_odometry_step_1/CMakeLists.txt index b49b7801..3642bc6a 100644 --- a/apps/lidar_odometry_step_1/CMakeLists.txt +++ b/apps/lidar_odometry_step_1/CMakeLists.txt @@ -45,6 +45,7 @@ target_include_directories( target_link_libraries( lidar_odometry_step_1 PRIVATE Fusion + unordered_dense::unordered_dense # PRIVATE ${THIRDPARTY_DIRECTORY}/glew-2.2.0/lib/Release/x64/glew32s.lib ${FREEGLUT_LIBRARY} ${OPENGL_gl_LIBRARY} diff --git a/apps/lidar_odometry_step_1/lidar_odometry_utils.h b/apps/lidar_odometry_step_1/lidar_odometry_utils.h index c57a74ce..fb6a656e 100644 --- a/apps/lidar_odometry_step_1/lidar_odometry_utils.h +++ b/apps/lidar_odometry_step_1/lidar_odometry_utils.h @@ -7,6 +7,8 @@ #include #include +#include + #include #include #include @@ -29,8 +31,8 @@ namespace fs = std::filesystem; -using NDTBucketMapType = std::unordered_map; -using NDTBucketMapType2 = std::unordered_map; +using NDTBucketMapType = ankerl::unordered_dense::map; +using NDTBucketMapType2 = ankerl::unordered_dense::map; // Helper function for getting software version from CMake macros inline std::string get_software_version() diff --git a/apps/livox_mid_360_intrinsic_calibration/CMakeLists.txt b/apps/livox_mid_360_intrinsic_calibration/CMakeLists.txt index cfe0e42e..4de91df0 100644 --- a/apps/livox_mid_360_intrinsic_calibration/CMakeLists.txt +++ b/apps/livox_mid_360_intrinsic_calibration/CMakeLists.txt @@ -31,6 +31,7 @@ target_include_directories( target_link_libraries( livox_mid_360_intrinsic_calibration PRIVATE Fusion + unordered_dense::unordered_dense ${FREEGLUT_LIBRARY} ${OPENGL_gl_LIBRARY} OpenGL::GLU diff --git a/apps/mandeye_mission_recorder_calibration/CMakeLists.txt b/apps/mandeye_mission_recorder_calibration/CMakeLists.txt index 2e027255..b4f92ea6 100644 --- a/apps/mandeye_mission_recorder_calibration/CMakeLists.txt +++ b/apps/mandeye_mission_recorder_calibration/CMakeLists.txt @@ -41,6 +41,7 @@ target_include_directories( target_link_libraries( mandeye_mission_recorder_calibration PRIVATE Fusion + unordered_dense::unordered_dense ${FREEGLUT_LIBRARY} ${OPENGL_gl_LIBRARY} OpenGL::GLU diff --git a/apps/mandeye_raw_data_viewer/CMakeLists.txt b/apps/mandeye_raw_data_viewer/CMakeLists.txt index c40e584e..f6f9074e 100644 --- a/apps/mandeye_raw_data_viewer/CMakeLists.txt +++ b/apps/mandeye_raw_data_viewer/CMakeLists.txt @@ -44,6 +44,7 @@ target_include_directories( target_link_libraries( mandeye_raw_data_viewer PRIVATE Fusion + unordered_dense::unordered_dense ${FREEGLUT_LIBRARY} ${OPENGL_gl_LIBRARY} OpenGL::GLU diff --git a/apps/mandeye_single_session_viewer/CMakeLists.txt b/apps/mandeye_single_session_viewer/CMakeLists.txt index 1bfd69a5..d2ddc227 100644 --- a/apps/mandeye_single_session_viewer/CMakeLists.txt +++ b/apps/mandeye_single_session_viewer/CMakeLists.txt @@ -40,6 +40,7 @@ target_include_directories( target_link_libraries( mandeye_single_session_viewer PRIVATE Fusion + unordered_dense::unordered_dense ${FREEGLUT_LIBRARY} ${OPENGL_gl_LIBRARY} OpenGL::GLU diff --git a/apps/multi_view_tls_registration/CMakeLists.txt b/apps/multi_view_tls_registration/CMakeLists.txt index 40532e7f..6e2fd8db 100644 --- a/apps/multi_view_tls_registration/CMakeLists.txt +++ b/apps/multi_view_tls_registration/CMakeLists.txt @@ -44,6 +44,7 @@ target_include_directories( multi_view_tls_registration_step_2 # PRIVATE ${THIRDPARTY_DIRECTORY}/glew-2.2.0/lib/Release/x64/glew32s.lib PRIVATE ${FREEGLUT_LIBRARY} + unordered_dense::unordered_dense ${OPENGL_gl_LIBRARY} OpenGL::GLU ${PLATFORM_LASZIP_LIB} From e19087396896359a050a55310857c6f391caef81 Mon Sep 17 00:00:00 2001 From: Danil An Date: Wed, 21 Jan 2026 21:31:27 +0400 Subject: [PATCH 3/3] python bindings build fix --- pybind/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pybind/CMakeLists.txt b/pybind/CMakeLists.txt index 14ad656c..d2effa62 100644 --- a/pybind/CMakeLists.txt +++ b/pybind/CMakeLists.txt @@ -120,9 +120,10 @@ target_link_libraries(core_py target_link_libraries(lidar_odometry_py - PRIVATE pybind11::module + PRIVATE pybind11::module core_no_gui - ${PLATFORM_LASZIP_LIB} + unordered_dense::unordered_dense + ${PLATFORM_LASZIP_LIB} Fusion ${PLATFORM_MISCELLANEOUS_LIBS} )