Skip to content

Commit 0edb1b8

Browse files
lpanafahojnnes
andauthored
Add rig support and upgrade colmap to version 3.12 (#201)
* rigged global positioning. Not debugged yet * compilation debugged * the rigged GP debugged * debug code * dbugging rig GP * rig rotation averaging implemented * minor * rigged bundle adjustment * rigged pipeline * largest connect componenet establishment with rigs * test entry point * remove unnecessary dependency * add support for relative pose estimation only * change the snapshot logic * minor * migrate to COLMAP 3..12 (with rig support) * refactor rotation averaging. RIGGED version not working yet * d * rigged rotation averaging debugged. The convergence is poor. * rigged global positioning * minor * add stratefied rotation averaging for initialization * rotation initializer * gravity refinement with rig support * unit test for mapper. Include additional non-trivial rig test * unit test for RA. Add test for rig support * add gravity aligned RA for rigs * move the gravity property to frames * add frame struct * pose io with gravity support * d * remove the old version * rename the rigged version back to normal * name back the rigged version to default * normalization with rig support * cleanup and add support for cam-to-cam constraints * add reconstruction normalization * cleanup * f * d * d * f * d * d * d * d * d * skip unconnected images * f * Update glomap/controllers/global_mapper.cc Co-authored-by: Johannes Schönberger <[email protected]> * Update glomap/controllers/global_mapper.cc Co-authored-by: Johannes Schönberger <[email protected]> * renaming * remove redundant files * temp cam_from_world * change version match to only consider the first two numbers * changed todo * renaming * refactor the code so the is_registered is a frame property * formulate the pruning with respect to frames * m * f * d * d * Update to latest colmap and poselib * Update glomap/estimators/cost_function.h Co-authored-by: Johannes Schönberger <[email protected]> * Update glomap/estimators/gravity_refinement.cc Co-authored-by: Johannes Schönberger <[email protected]> * Update glomap/estimators/gravity_refinement.cc Co-authored-by: Johannes Schönberger <[email protected]> * address minor issues * clean up * f * d * cleanup * expose optimize_rig_poses in cli * fix the bug for the reconstruction output when there are more than 1 cluster * f * make pair_id consistent with colmap * fix the bug for ba with rig calibration * f * f * stablize the reconstruction by removing nearly degenerate points * d * d * d * d * d * d * d * d * d * d * d * d --------- Co-authored-by: Johannes Schönberger <[email protected]> Co-authored-by: Johannes Schönberger <[email protected]>
1 parent 4f475de commit 0edb1b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2337
-607
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ Checks: >
22
performance-*,
33
concurrency-*,
44
bugprone-*,
5+
-clang-analyzer-security.ArrayBound,
56
-bugprone-easily-swappable-parameters,
67
-bugprone-exception-escape,
78
-bugprone-implicit-widening-of-multiplication-result,
89
-bugprone-narrowing-conversions,
910
-bugprone-reserved-identifier,
1011
-bugprone-unchecked-optional-access,
12+
-performance-enum-size,
1113
cppcoreguidelines-virtual-class-destructor,
1214
google-explicit-constructor,
1315
google-build-using-namespace,

.github/workflows/mac.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040

4141
- name: Setup Mac
4242
run: |
43+
brew upgrade cmake || brew install cmake
4344
brew install \
44-
cmake \
4545
ninja \
4646
boost \
4747
eigen \
@@ -56,6 +56,7 @@ jobs:
5656
cgal \
5757
sqlite3 \
5858
ccache
59+
brew link --force libomp
5960
6061
- name: Configure and build
6162
run: |

.github/workflows/ubuntu.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,46 @@ on:
1111

1212
jobs:
1313
build:
14-
name: ${{ matrix.config.os }} ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} ${{ matrix.config.asanEnabled && 'ASan' || '' }}
14+
name: ${{ matrix.config.os }} ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} ${{ matrix.config.asanEnabled && 'ASan' || '' }} ${{ matrix.config.coverageEnabled && 'Coverage' || '' }}
1515
runs-on: ${{ matrix.config.os }}
1616
strategy:
1717
matrix:
1818
config: [
1919
{
2020
os: ubuntu-24.04,
21+
qtVersion: 6,
2122
cmakeBuildType: RelWithDebInfo,
2223
asanEnabled: false,
2324
cudaEnabled: false,
2425
checkCodeFormat: true,
2526
},
2627
{
2728
os: ubuntu-22.04,
29+
qtVersion: 6,
2830
cmakeBuildType: Release,
2931
asanEnabled: false,
3032
cudaEnabled: false,
3133
checkCodeFormat: true,
3234
},
3335
{
3436
os: ubuntu-22.04,
37+
qtVersion: 5,
3538
cmakeBuildType: Release,
3639
asanEnabled: false,
3740
cudaEnabled: true,
3841
checkCodeFormat: false,
3942
},
4043
{
41-
os: ubuntu-22.04,
44+
os: ubuntu-24.04,
45+
qtVersion: 6,
4246
cmakeBuildType: Release,
4347
asanEnabled: true,
4448
cudaEnabled: false,
4549
checkCodeFormat: false,
4650
},
4751
{
48-
os: ubuntu-22.04,
52+
os: ubuntu-24.04,
53+
qtVersion: 6,
4954
cmakeBuildType: ClangTidy,
5055
asanEnabled: false,
5156
cudaEnabled: false,
@@ -59,6 +64,8 @@ jobs:
5964
CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache
6065
CCACHE_BASEDIR: ${{ github.workspace }}
6166
CTCACHE_DIR: ${{ github.workspace }}/compiler-cache/ctcache
67+
GLOG_v: 2
68+
GLOG_logtostderr: 1
6269

6370
steps:
6471
- uses: actions/checkout@v4
@@ -100,6 +107,12 @@ jobs:
100107
101108
- name: Setup Ubuntu
102109
run: |
110+
if [ "${{ matrix.config.qtVersion }}" == "5" ]; then
111+
qt_packages="qtbase5-dev libqt5opengl5-dev libcgal-qt5-dev"
112+
elif [ "${{ matrix.config.qtVersion }}" == "6" ]; then
113+
qt_packages="qt6-base-dev libqt6opengl6-dev libqt6openglwidgets6"
114+
fi
115+
103116
sudo apt-get update && sudo apt-get install -y \
104117
build-essential \
105118
cmake \
@@ -117,7 +130,7 @@ jobs:
117130
libgmock-dev \
118131
libsqlite3-dev \
119132
libglew-dev \
120-
qtbase5-dev \
133+
$qt_packages \
121134
libqt5opengl5-dev \
122135
libcgal-dev \
123136
libcgal-qt5-dev \
@@ -145,15 +158,15 @@ jobs:
145158
fi
146159
147160
if [ "${{ matrix.config.asanEnabled }}" == "true" ]; then
148-
sudo apt-get install -y clang-15 libomp-15-dev
149-
echo "CC=/usr/bin/clang-15" >> $GITHUB_ENV
150-
echo "CXX=/usr/bin/clang++-15" >> $GITHUB_ENV
161+
sudo apt-get install -y clang-18 libomp-18-dev
162+
echo "CC=/usr/bin/clang-18" >> $GITHUB_ENV
163+
echo "CXX=/usr/bin/clang++-18" >> $GITHUB_ENV
151164
fi
152165
153166
if [ "${{ matrix.config.cmakeBuildType }}" == "ClangTidy" ]; then
154-
sudo apt-get install -y clang-15 clang-tidy-15 libomp-15-dev
155-
echo "CC=/usr/bin/clang-15" >> $GITHUB_ENV
156-
echo "CXX=/usr/bin/clang++-15" >> $GITHUB_ENV
167+
sudo apt-get install -y clang-18 clang-tidy-18 libomp-18-dev
168+
echo "CC=/usr/bin/clang-18" >> $GITHUB_ENV
169+
echo "CXX=/usr/bin/clang++-18" >> $GITHUB_ENV
157170
fi
158171
159172
- name: Upgrade CMake
@@ -183,7 +196,7 @@ jobs:
183196
184197
- name: Run tests
185198
if: ${{ matrix.config.cmakeBuildType != 'ClangTidy' }}
186-
run: |
199+
run: |
187200
export DISPLAY=":99.0"
188201
export QT_QPA_PLATFORM="offscreen"
189202
Xvfb :99 &

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/build
22
/data
33
/.vscode
4+
/compile_commands.json

cmake/FindDependencies.cmake

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if(NOT TARGET SuiteSparse::CHOLMOD)
77
endif()
88
find_package(Ceres REQUIRED COMPONENTS SuiteSparse)
99
find_package(Boost REQUIRED)
10+
find_package(OpenMP REQUIRED COMPONENTS C CXX)
1011

1112
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
1213
find_package(Glog REQUIRED)
@@ -26,7 +27,7 @@ endif()
2627
include(FetchContent)
2728
FetchContent_Declare(PoseLib
2829
GIT_REPOSITORY https://github.com/PoseLib/PoseLib.git
29-
GIT_TAG 0439b2d361125915b8821043fca9376e6cc575b9
30+
GIT_TAG 7e9f5f53372e43f89655040d4dfc4a00e5ace11c # 2.0.5
3031
EXCLUDE_FROM_ALL
3132
SYSTEM
3233
)
@@ -40,30 +41,14 @@ message(STATUS "Configuring PoseLib... done")
4041

4142
FetchContent_Declare(COLMAP
4243
GIT_REPOSITORY https://github.com/colmap/colmap.git
43-
GIT_TAG 78f1eefacae542d753c2e4f6a26771a0d976227d
44+
GIT_TAG c5f9cefc87e5dd596b638e4cee0ff543c7d14755 # Oct 23 2025
4445
EXCLUDE_FROM_ALL
4546
)
4647
message(STATUS "Configuring COLMAP...")
4748
set(UNINSTALL_ENABLED OFF CACHE INTERNAL "")
49+
set(GUI_ENABLED OFF CACHE INTERNAL "")
4850
if (FETCH_COLMAP)
4951
FetchContent_MakeAvailable(COLMAP)
50-
51-
# Define where to store the patch
52-
set(COLMAP_PATCH_PATH ${CMAKE_BINARY_DIR}/fix_poisson.patch)
53-
54-
# Download the patch from GitHub
55-
file(DOWNLOAD
56-
https://github.com/colmap/colmap/commit/a586e7cb223cc86c609105246ecd3a10e0c55131.patch
57-
${COLMAP_PATCH_PATH}
58-
SHOW_PROGRESS
59-
STATUS PATCH_DOWNLOAD_STATUS
60-
)
61-
# Apply the patch
62-
execute_process(
63-
COMMAND git apply ${COLMAP_PATCH_PATH}
64-
WORKING_DIRECTORY ${colmap_SOURCE_DIR}
65-
RESULT_VARIABLE PATCH_RESULT
66-
)
6752
else()
6853
find_package(COLMAP REQUIRED)
6954
endif()

glomap/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set(SOURCES
99
estimators/global_rotation_averaging.cc
1010
estimators/gravity_refinement.cc
1111
estimators/relpose_estimation.cc
12+
estimators/rotation_initializer.cc
1213
estimators/view_graph_calibration.cc
1314
io/colmap_converter.cc
1415
io/colmap_io.cc
@@ -38,8 +39,9 @@ set(HEADERS
3839
estimators/global_positioning.h
3940
estimators/global_rotation_averaging.h
4041
estimators/gravity_refinement.h
41-
estimators/relpose_estimation.h
4242
estimators/optimization_base.h
43+
estimators/relpose_estimation.h
44+
estimators/rotation_initializer.h
4345
estimators/view_graph_calibration.h
4446
io/colmap_converter.h
4547
io/colmap_io.h
@@ -58,6 +60,7 @@ set(HEADERS
5860
processors/track_filter.h
5961
processors/view_graph_manipulation.h
6062
scene/camera.h
63+
scene/frame.h
6164
scene/image_pair.h
6265
scene/image.h
6366
scene/track.h
@@ -84,6 +87,7 @@ target_link_libraries(
8487
Eigen3::Eigen
8588
Ceres::ceres
8689
SuiteSparse::CHOLMOD
90+
OpenMP::OpenMP_CXX
8791
${BOOST_LIBRARIES}
8892
)
8993
target_include_directories(glomap PUBLIC ..)
@@ -112,7 +116,6 @@ target_link_libraries(glomap_main glomap)
112116
set_target_properties(glomap_main PROPERTIES OUTPUT_NAME glomap)
113117
install(TARGETS glomap_main DESTINATION bin)
114118

115-
116119
if(TESTS_ENABLED)
117120
add_executable(glomap_test
118121
controllers/global_mapper_test.cc

0 commit comments

Comments
 (0)