Skip to content

feat(tool): add offline map merge via cross-map loop closure#150

Draft
junlinp wants to merge 3 commits into
mainfrom
junlinp/merge-maps
Draft

feat(tool): add offline map merge via cross-map loop closure#150
junlinp wants to merge 3 commits into
mainfrom
junlinp/merge-maps

Conversation

@junlinp
Copy link
Copy Markdown
Collaborator

@junlinp junlinp commented May 21, 2026

Summary

  • Add tool/merge_maps.py to merge two TinyNav map directories into one output map.
  • Find cross-map loop closure with saved DINO embeddings, verify candidates with SuperPoint + LightGlue, estimate alignment via PnP, and optimize the map-B-to-map-A transform with the pose graph solver.
  • Add scripts/run_map_merge.sh launcher with CLI flags for map paths, thresholds, and device/runtime environment setup.

Test plan

  • Run bash scripts/run_map_merge.sh --map-a <map_a> --map-b <map_b> --output <merged> --overwrite on two overlapping maps with valid embeddings/features.
  • Confirm output contains merged poses.npy, occupancy_grid.npy, sdf_map.npy, and merge_report.json.
  • Verify merged poses and occupancy look consistent in RViz or existing map visualization tooling.

Made with Cursor

Add merge_maps.py and run_map_merge.sh to align two TinyNav maps with DINO embeddings, LightGlue verification, and pose-graph optimization.
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (259.3 files/s, 38431.7 lines/s)
Language files blank comment code
Python 13 619 262 3462
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 16 49 18 367
Dockerfile 1 31 32 203
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 43 948 371 5055

Drop duplicate TinyNavDB/find_loop, remove feature truncation, and call save_map_occupancy so merged maps write occupancy_2d_image.png like build_map_node.
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (253.3 files/s, 37541.9 lines/s)
Language files blank comment code
Python 13 619 262 3462
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 16 49 18 367
Dockerfile 1 31 32 203
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 43 948 371 5055

Use existing generate_occupancy_map and TinyNavDB APIs so merge_maps works without adding save_map_occupancy to build_map_node.
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.13 s (320.5 files/s, 47511.1 lines/s)
Language files blank comment code
Python 13 619 262 3462
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 16 49 18 367
Dockerfile 1 31 32 203
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 43 948 371 5055

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.

1 participant