Skip to content

Commit

Permalink
Features/ground align and pruning (#55)
Browse files Browse the repository at this point in the history
* write cpp test for heaptrack

* add ground alignment part

* add self-similarity check

* add ground align to heaptrack test

* remove unused piece of code

* remove self_similarity_filter flag, make it default

* modify pipeline to return all closures for a given local map

* update test.cpp for changes in api

* modify density map generation after heaptrack insights

* use std::size_t for container sizes type consistently

* modify functions to implicitly ground align and prune features, rename and constexpr stuff

* remove test code for heaptrack

* remove explicit API call for ground alignment

* modify default config

* remove explicit ground alignment, no downsampling before adding to local map

* add numeric coz windows is dumb

* new API for best, top_k and all closures per map

* remove - to also push tar.gz artifact to pypi

* Change in API

* massive change in API: replace match_and_add function with get_closures

* remove gt_closures_pipeline stuff, related 3rdparty librbries

* remove from README as well, still available on ICRA2024 tag

* add readme to python folder for pypi description

* bump version to 2.0.0

* fix name of func

* remove the local_map_factor config

---------

Co-authored-by: tizianoGuadagnino <[email protected]>
  • Loading branch information
saurabh1002 and tizianoGuadagnino authored Jan 20, 2025
1 parent eef1d23 commit 4a2ad69
Show file tree
Hide file tree
Showing 35 changed files with 462 additions and 970 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libeigen3-dev libtbb-dev libopencv-dev
sudo apt-get install -y build-essential cmake git libeigen3-dev libopencv-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/cpp
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
pattern: artifact*
path: dist
merge-multiple: true

Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/MapClosures/blob/main/README.md#Install">Install</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://www.ipb.uni-bonn.de/pdfs/gupta2024icra.pdf>Paper</a>
<a href=https://www.ipb.uni-bonn.de/pdfs/gupta2024icra.pdf>ICRA24 Paper</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://github.com/PRBonn/MapClosures/issues>Contact Us</a>
<br />
Expand All @@ -30,7 +30,6 @@ Effectively Detecting Loop Closures using Point Cloud Density Maps.
1. Include the following snippet in your project's `CMakeLists.txt`:
```cmake
set(USE_SYSTEM_EIGEN3 ON CACHE BOOL "use system eigen3")
set(USE_SYSTEM_TBB ON CACHE BOOL "use system tbb")
set(USE_SYSTEM_OPENCV ON CACHE BOOL "use system opencv")
include(FetchContent)
Expand Down Expand Up @@ -102,11 +101,6 @@ git checkout ICRA2024
```
Our development aims to push the performances of **MapClosures** above the original results of the paper.

**Note**: You can download the ground-truth loop closure candidates for the datasets used in the paper from [here](https://www.ipb.uni-bonn.de/html/projects/gupta2024icra/MapClosuresGroundtruth.zip). When run with `-e` flag, our pipeline will search for groundtruth data under the folder at path `<data>/loop_closure/`. If not found, it will first generate the groundtruth closures which might consume some time. You can also generate the groundtruth closures following the approach mentioned in our paper using the following command:
```sh
gt_closure_pipeline <dataloader> <path-to-data>
```


## Acknowledgement

Expand Down
1 change: 0 additions & 1 deletion config/basic_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ density_map_resolution: 0.5
density_threshold: 0.05
hamming_distance_threshold: 50
inliers_threshold: 5
local_map_factor: 1.0 # Local Map size as a multiple of the maximum range of the LiDAR
4 changes: 1 addition & 3 deletions cpp/3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ macro(find_external_dependency PACKAGE_NAME TARGET_NAME INCLUDED_CMAKE_PATH)
endmacro()

find_external_dependency("Eigen3" "Eigen3::Eigen" "${CMAKE_CURRENT_LIST_DIR}/eigen/eigen.cmake")
find_external_dependency("TBB" "TBB::tbb" "${CMAKE_CURRENT_LIST_DIR}/tbb/tbb.cmake")
find_external_dependency("OpenCV" "opencv_features2d"
"${CMAKE_CURRENT_LIST_DIR}/opencv/opencv.cmake")
find_external_dependency("tsl-robin-map" "tsl::robin_map"
"${CMAKE_CURRENT_LIST_DIR}/tsl_robin/tsl_robin.cmake")
find_external_dependency("Sophus" "Sophus::Sophus" "${CMAKE_CURRENT_LIST_DIR}/sophus/sophus.cmake")

include(${CMAKE_CURRENT_LIST_DIR}/hbst/hbst.cmake)
12 changes: 5 additions & 7 deletions cpp/3rdparty/tsl_robin/LICENSE → cpp/3rdparty/sophus/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
MIT License

Copyright (c) 2017 Thibaut Goetghebuer-Planchon <[email protected]>
Copyright (c) 2008-2015 Jesse Beder.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +7,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWAR
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MIT License
#
# Copyright (c) 2022 Ignacio Vizzo, Tiziano Guadagnino, Benedikt Mersch, Cyrill
# Stachniss.
# # Copyright (c) 2023 Saurabh Gupta, Ignacio Vizzo, Cyrill Stachniss, University of Bonn
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,6 +20,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include(FetchContent)
FetchContent_Declare(tessil SYSTEM
URL https://github.com/Tessil/robin-map/archive/refs/tags/v1.2.1.tar.gz)
FetchContent_MakeAvailable(tessil)

set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru")
set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests")
set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples")

FetchContent_Declare(
sophus SYSTEM URL https://github.com/strasdat/Sophus/archive/refs/tags/1.22.10.tar.gz
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/sophus.patch UPDATE_DISCONNECTED 1)

FetchContent_MakeAvailable(sophus)
12 changes: 12 additions & 0 deletions cpp/3rdparty/sophus/sophus.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/sophus/common.hpp b/sophus/common.hpp
index 5634d35b..56a1b590 100644
--- a/sophus/common.hpp
+++ b/sophus/common.hpp
@@ -18,7 +18,7 @@
#define SOPHUS_FMT_CSTR(description, ...) description
#define SOPHUS_FMT_STR(description, ...) std::string(description)
#define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description)
-#define SOPHUS_FMT_ARG(arg)
+#define SOPHUS_FMT_ARG(arg) arg

#else // !SOPHUS_USE_BASIC_LOGGING
201 changes: 0 additions & 201 deletions cpp/3rdparty/tbb/LICENSE

This file was deleted.

45 changes: 0 additions & 45 deletions cpp/3rdparty/tbb/tbb.cmake

This file was deleted.

Loading

0 comments on commit 4a2ad69

Please sign in to comment.