Skip to content

Step 2: BoW loop closure, ICP all edges, speed up pair-wise icp - #631

Merged
JanuszBedkowski merged 9 commits into
mainfrom
mp/bow
Nov 12, 2026
Merged

JanuszBedkowski merged 9 commits into
mainfrom
mp/bow

Conversation

@michalpelka

Copy link
Copy Markdown
Contributor
  • BoW loop closure detector (GUI + bow_loop_closure_detect): multiple camera folders, score as pre-filter only (min_bow_score 0.005, min_inliers 30), max_image_size_px downscaling; candidate preview with Show/Remove/ Previous/Next edge, "Add all shown" clears the list
  • New session_intensity_panoramas tool: lidar intensity panoramas usable as a BoW camera folder
  • "ICP all edges" coarse-to-fine from a start radius, with progress/Cancel; run_icp() returns success
  • PairWiseICP: per-block normal equations without per-point lock, index built once (deterministic sum)
  • Compute Pose Graph SLAM in the top menu bar; N/P step edges/candidates; 1-9 point size keys work with a focused window and resize all scans
  • Step 3: edge list scrolls in a child window
  • File dialogs start in the folder of a dropped/command-line file; OOM hint logged via spdlog

@michalpelka michalpelka changed the title Step 2: BoW loop closure, ICP all edges, faster PairWiseICP Step 2: BoW loop closure, ICP all edges Nov 11, 2026
@michalpelka michalpelka changed the title Step 2: BoW loop closure, ICP all edges Step 2: BoW loop closure, ICP all edges, speed up pair-wise icp Nov 11, 2026
@michalpelka
michalpelka marked this pull request as draft November 11, 2026 01:36
@michalpelka
michalpelka force-pushed the mp/bow branch 2 times, most recently from 3436207 to 1b94577 Compare November 11, 2026 01:57
@michalpelka
michalpelka marked this pull request as ready for review November 11, 2026 01:57
michalpelka and others added 7 commits November 11, 2026 23:06
- BoW loop closure detector (GUI + bow_loop_closure_detect): multiple camera
  folders, score as pre-filter only (min_bow_score 0.005, min_inliers 30),
  max_image_size_px downscaling; candidate preview with Show/Remove/
  Previous/Next edge, "Add all shown" clears the list
- New session_intensity_panoramas tool: lidar intensity panoramas usable as
  a BoW camera folder
- "ICP all edges" coarse-to-fine from a start radius, with progress/Cancel;
  run_icp() returns success
- Compute Pose Graph SLAM in the top menu bar; N/P step edges/candidates;
  1-9 point size keys work with a focused window and resize all scans
- Step 3: edge list scrolls in a child window
- File dialogs start in the folder of a dropped/command-line file; OOM hint
  logged via spdlog

Signed-off-by: Michal Pelka <michalpelka@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New doctest target hdmapping_core_tests (BUILD_TESTING=ON), linking
core_no_gui. On a synthetic room scan (portable RNG) it checks that
compute() recovers a known 0.2 m / 2 deg offset coarse to fine, returns
false without correspondences or with fewer than 100, and pins the pose of
a fixed 10-iteration run to 1e-9 so refactors of compute() keep the
numbers (rounding differs by ~1e-16; searching the last point of each
bucket would move it ~2e-4).

Signed-off-by: Michal Pelka <michalpelka@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the target's bucket index once per call; 256 blocks of source points
each sum their own normal equations, added in a fixed order (deterministic).
Results on 3 loop edges identical to 12 decimals; 32 -> 23 s per edge
(measured under load, needs an idle Release measurement).

Signed-off-by: Michal Pelka <michalpelka@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fbow includes <immintrin.h> and uses cpuid except on Android.
3rdparty/patches/fbow_non_x86.patch takes those portable paths on any
non-x86 CPU (keeping 64-bit hamming words on 64-bit ARM); dependencies.cmake
applies it to the submodule on non-x86 hosts, skipping it if already applied.

Signed-off-by: Michal Pelka <michalpelka@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Michal Pelka <michalpelka@gmail.com>
std::execution::par_unseq is compiled out with AppleClang
(USE_EXECUTION_PAR_UNSEQ=0), so ICP ran on one core on macOS. The 256
blocks now go through tbb::parallel_for_each; block sums are still added in
a fixed order, so results are unchanged. core_math links TBB so it compiles
against the bundled oneTBB headers, not Homebrew's (2023.2 vs bundled 2022.3).

Synthetic bench (300k target / 150k source, radii 1.0/0.5/0.25 m, 30 it.,
M-series Mac): 14.2 s -> 2.5 s, poses identical to 12 decimals.

Signed-off-by: Michal Pelka <michalpelka@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fbow's CMakeLists sets BUILD_SHARED_LIBS=ON and, on Windows, the
EXECUTABLE/LIBRARY/RUNTIME_OUTPUT_PATH cache entries, which turned raylib
and glad into shared libs (undefined glfw*/glad_gl* at link) and moved
vqf.lib out of lib/Release. Pin BUILD_SHARED_LIBS=OFF around fbow and
drop the leaked entries afterwards, as already done for Xerces.

multi_session_registration_py compiles pfd_wrapper.cpp, which now
includes spdlog, so link spdlog::spdlog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michalpelka and others added 2 commits November 12, 2026 00:00
The neighbour search skipped the last target point of each bucket, and
std::sort leaves the order within a bucket to the standard library, so
libc++, libstdc++ and MSVC skipped different points and the reference
test failed on Linux and Windows (about 2e-4 apart). Search the whole
bucket and break sort ties by point index (also in compute_fast), so
the result is the same on every platform. Reference values regenerated;
the result is closer to the ground truth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scene was built with several jitter()/rng.uniform() calls in one
argument list, whose evaluation order is unspecified (clang: left to
right; GCC, MSVC: right to left), so each compiler built a different
room and the reference test failed on Linux and Windows. Draw them in
separate statements in x, y, z order, as clang did, so the reference
values are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JanuszBedkowski
JanuszBedkowski merged commit 99f9208 into main Nov 12, 2026
7 checks passed
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