Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
36e1ffa
Fixes in response to compiler warnings, unused variables.
amarburg Jan 8, 2026
b84a140
Update to README
amarburg Jan 8, 2026
d2b3c3b
Moved EuRoC into its own subdir
amarburg Jan 10, 2026
5d6ee9d
Wide ranging code fixes while debugging EuRoC performance
amarburg Jan 10, 2026
2e1d4f7
Add RelWithDebInfo build option.
amarburg Jan 16, 2026
1481d28
Fixes from comparison with baseline implementation.
amarburg Jan 16, 2026
56bbb5e
De-const Keyframe; boost deserialization requires the default constru…
amarburg Jan 16, 2026
c91bc3a
Clean up Optimizer code.
amarburg Jan 16, 2026
270e249
Continued code cleanup
amarburg Jan 18, 2026
aa110d3
Congregate EuRoC binaries, port the non-inertial examples.
amarburg Jan 18, 2026
9dd19f5
Working on EuRoC monocular
amarburg Jan 21, 2026
1e7b5ac
Handle comments in timestamp file
amarburg Jan 22, 2026
d0481fb
Revised Logger singleton and introduce oslog::
amarburg Jan 28, 2026
bc50629
Merge pull request #7 from apl-ocean-engineering/dev/revise_logging_s…
amarburg Jan 28, 2026
a6a7faf
Code cleanup and changes while chasing Eigen alignment issues.
amarburg Feb 2, 2026
9066bc8
Start to break down G2OTypes to accelerate compilation
amarburg Feb 2, 2026
797a41d
Reduce verbosity of Optimizer
amarburg Feb 2, 2026
eb45a05
Improvements to output
amarburg Feb 3, 2026
43ac472
Move Edge4DoF::computeError() to .cc
amarburg Feb 3, 2026
bc39700
Fix bugs in rectification
amarburg Feb 3, 2026
af81155
Remove lock on Eigen 3.4.0
amarburg Feb 3, 2026
25be65c
Make explicit -dynamic config target, update vcpkg
amarburg Feb 3, 2026
c7e4c3f
Centralize EuRoC logging, cleanup justfile
amarburg Feb 3, 2026
1c6dd95
Minor EuRoC justfile cleanup
amarburg Feb 3, 2026
84e82f4
Iteration on EuRoC binaries
amarburg Feb 4, 2026
e3a9eb7
Reorganize Examples directory by dataset
amarburg Feb 4, 2026
c7ef967
Remove dead code and extraneous output
amarburg Feb 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ my_settings.txt
borrar/*

*/ExecMean.txt
vcpkg_installed/
170 changes: 102 additions & 68 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,65 @@
cmake_minimum_required(VERSION 3.28)
project(ORB_SLAM3)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
IF(NOT CONFIG)
SET(CONFIG Release)
ENDIF()

MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})
MESSAGE("Build type: " ${CONFIG})

# Squelch "reorder" warnings, there are many
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-reorder")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-reorder")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -march=native -O3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native -O3")
add_compile_options(
"$<$<CONFIG:Debug>:-g;-Wall;-Wno-reorder>"
"$<$<CONFIG:RelWithDebInfo>:-O3;-g;-UNDEBUG>"
"$<$<CONFIG:Release>:-march=native;-O3>"
)

add_link_options(
-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
)
if(DO_SANITIZE)
add_compile_options(
"$<$<CONFIG:Debug>:-fsanitize=address;-fno-omit-frame-pointer;-fsanitize=undefined>"
"$<$<CONFIG:RelWithDebInfo>:-fsanitize=address;-fno-omit-frame-pointer;-fsanitize=undefined>"
"$<$<CONFIG:Release>:-fsanitize=address;-fno-omit-frame-pointer;-fsanitize=undefined>"
)

add_link_options(
-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
)
endif()

#add_compile_definitions(EIGEN_DONT_VECTORIZE EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)

find_package(OpenCV 4.4)
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV > 4.4 not found.")
endif()
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV > 4.4 not found.")
endif()

MESSAGE("OPENCV VERSION:")
MESSAGE(${OpenCV_VERSION})

find_package(Eigen3 REQUIRED)
find_package(Eigen3 CONFIG REQUIRED)
find_package(Pangolin CONFIG REQUIRED)
find_package(Sophus CONFIG REQUIRED)
find_package(g2o REQUIRED)
find_package(g2o CONFIG REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Boost REQUIRED COMPONENTS serialization)

add_subdirectory(Thirdparty/DBoW2)

include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/CameraModels
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/CameraModels
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
Expand All @@ -52,7 +71,8 @@ add_library(${PROJECT_NAME} SHARED
src/Converter.cc
src/Frame.cc
src/FrameDrawer.cc
src/G2oTypes.cc
src/G2OTypes/Edges.cc
src/G2OTypes/Vertices.cc
src/GeometricTools.cc
src/ImuTypes.cc
src/KeyFrame.cc
Expand All @@ -63,7 +83,12 @@ add_library(${PROJECT_NAME} SHARED
src/MapDrawer.cc
src/MapPoint.cc
src/MLPnPsolver.cpp
src/OptimizableTypes.cpp
src/OptimizableTypes/edge_se3_project_xyz_only_pose.cpp
src/OptimizableTypes/edge_se3_project_xyz_only_pose_to_body.cpp
src/OptimizableTypes/edge_se3_project_xyz.cpp
src/OptimizableTypes/edge_se3_project_xyz_to_body.cpp
src/OptimizableTypes/edge_sim3_project_xyz.cpp
src/OptimizableTypes/vertex_sim3_expmap.cpp
src/Optimizer.cc
src/ORBextractor.cc
src/ORBmatcher.cc
Expand All @@ -78,82 +103,91 @@ add_library(${PROJECT_NAME} SHARED
target_compile_definitions(${PROJECT_NAME} PUBLIC REGISTER_TIMES)

target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
Eigen3::Eigen
Sophus::Sophus
PUBLIC
opencv_core
opencv_imgproc
${Pangolin_LIBRARIES}
DBoW2
fmt::fmt
g2o::core
g2o::types_sim3
g2o::types_slam3d
spdlog::spdlog
Boost::boost
Boost::serialization
-lcrypto
PRIVATE
OpenSSL::Crypto
Eigen3::Eigen
Sophus::Sophus
g2o::core
g2o::types_sim3
g2o::types_slam3d
)

# Build examples

# RGB-D examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/RGB-D)
# ===============================================
# EuRoC examples
# ===============================================
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/EuRoC)

add_executable(rgbd_tum
Examples/RGB-D/rgbd_tum.cc)
target_link_libraries(rgbd_tum ${PROJECT_NAME})
add_executable(stereo_euroc
Examples/EuRoC/stereo_euroc.cc
Examples/EuRoC/euroc_common.cc)
target_link_libraries(stereo_euroc ${PROJECT_NAME})

# Not ported yet...
# add_executable(stereo_inertial_euroc
# Examples/EuRoC/stereo_inertial_euroc.cc
# Examples/EuRoC/euroc_common.cc)
# target_link_libraries(stereo_inertial_euroc ${PROJECT_NAME})

add_executable(mono_euroc
Examples/EuRoC/mono_euroc.cc
Examples/EuRoC/euroc_common.cc)
target_link_libraries(mono_euroc ${PROJECT_NAME})

add_executable(mono_inertial_euroc
Examples/EuRoC/mono_inertial_euroc.cc
Examples/EuRoC/euroc_common.cc)
target_link_libraries(mono_inertial_euroc ${PROJECT_NAME})

#Stereo examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Stereo)
# ===============================================
# KITTI examples
# ===============================================
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Kitti)

add_executable(stereo_kitti
Examples/Stereo/stereo_kitti.cc)
Examples/Kitti/stereo_kitti.cc)
target_link_libraries(stereo_kitti ${PROJECT_NAME})

add_executable(stereo_euroc
Examples/Stereo/stereo_euroc.cc)
target_link_libraries(stereo_euroc ${PROJECT_NAME})
add_executable(mono_kitti
Examples/Kitti/mono_kitti.cc)
target_link_libraries(mono_kitti ${PROJECT_NAME})

add_executable(stereo_tum_vi
Examples/Stereo/stereo_tum_vi.cc)
target_link_libraries(stereo_tum_vi ${PROJECT_NAME})
# ===============================================
# TUM examples
# ===============================================
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/TUM)

add_executable(rgbd_tum
Examples/TUM/rgbd_tum.cc)
target_link_libraries(rgbd_tum ${PROJECT_NAME})

#Monocular examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Monocular)

add_executable(mono_tum
Examples/Monocular/mono_tum.cc)
Examples/TUM/mono_tum.cc)
target_link_libraries(mono_tum ${PROJECT_NAME})

add_executable(mono_kitti
Examples/Monocular/mono_kitti.cc)
target_link_libraries(mono_kitti ${PROJECT_NAME})

add_executable(mono_euroc
Examples/Monocular/mono_euroc.cc)
target_link_libraries(mono_euroc ${PROJECT_NAME})
add_executable(stereo_tum_vi
Examples/TUM/stereo_tum_vi.cc)
target_link_libraries(stereo_tum_vi ${PROJECT_NAME})

add_executable(mono_tum_vi
Examples/Monocular/mono_tum_vi.cc)
Examples/TUM/mono_tum_vi.cc)
target_link_libraries(mono_tum_vi ${PROJECT_NAME})

#Monocular inertial examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Monocular-Inertial)

add_executable(mono_inertial_euroc
Examples/Monocular-Inertial/mono_inertial_euroc.cc)
target_link_libraries(mono_inertial_euroc ${PROJECT_NAME})

add_executable(mono_inertial_tum_vi
Examples/Monocular-Inertial/mono_inertial_tum_vi.cc)
Examples/TUM/mono_inertial_tum_vi.cc)
target_link_libraries(mono_inertial_tum_vi ${PROJECT_NAME})

#Stereo Inertial examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Stereo-Inertial)

add_executable(stereo_inertial_euroc
Examples/Stereo-Inertial/stereo_inertial_euroc.cc)
target_link_libraries(stereo_inertial_euroc ${PROJECT_NAME})

add_executable(stereo_inertial_tum_vi
Examples/Stereo-Inertial/stereo_inertial_tum_vi.cc)
Examples/TUM/stereo_inertial_tum_vi.cc)
target_link_libraries(stereo_inertial_tum_vi ${PROJECT_NAME})
25 changes: 22 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,38 @@
"description": "Configure with vcpkg toolchain and generate Ninja project files for all configurations",
"binaryDir": "${sourceDir}/builds/${presetName}",
"generator": "Ninja Multi-Config",
"toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake"
"toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {}
},
{
"name": "ninja-multi-vcpkg-dynamic",
"displayName": "Ninja Multi-Config with Dynamic Libraries",
"description": "Configure with vcpkg toolchain and generate Ninja project files for all configurations",
"binaryDir": "${sourceDir}/builds/${presetName}",
"generator": "Ninja Multi-Config",
"toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-linux-dynamic"
}
}
],
"buildPresets": [
{
"name": "ninja-vcpkg-debug",
"name": "ninja-vcpkg-Debug",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build (Debug)",
"description": "Build with Ninja/vcpkg (Debug)",
"configuration": "Debug"
},
{
"name": "ninja-vcpkg-release",
"name": "ninja-vcpkg-RelWithDebInfo",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build (RelWithDebInfo)",
"description": "Build with Ninja/vcpkg (RelWithDebInfo)",
"configuration": "RelWithDebInfo"
},
{
"name": "ninja-vcpkg-Release",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build (Release)",
"description": "Build with Ninja/vcpkg (Release)",
Expand Down
34 changes: 5 additions & 29 deletions Dependencies.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
##List of Known Dependencies
###ORB-SLAM3 v1.0
# List of Known Dependencies

In this document we list all the pieces of code included by ORB-SLAM3 and linked libraries which are not property of the authors of ORB-SLAM3.
## ORB-SLAM3 v1.0

In this document we list all the pieces of code included by ORB-SLAM3 and linked libraries which are not property of the authors of ORB-SLAM3.

#####Code in **src** and **include** folders
### Code in **src** and **include** folders

* *ORBextractor.cc*.
This is a modified version of orb.cpp of OpenCV library. The original code is BSD licensed.

* *PnPsolver.h, PnPsolver.cc*.
This is a modified version of the epnp.h and epnp.cc of Vincent Lepetit.
This code can be found in popular BSD licensed computer vision libraries as [OpenCV](https://github.com/Itseez/opencv/blob/master/modules/calib3d/src/epnp.cpp) and [OpenGV](https://github.com/laurentkneip/opengv/blob/master/src/absolute_pose/modules/Epnp.cpp). The original code is FreeBSD.
This is a modified version of `orb.cpp` of OpenCV library. The original code is BSD licensed.

* *MLPnPsolver.h, MLPnPsolver.cc*.
This is a modified version of the MLPnP of Steffen Urban from [here](https://github.com/urbste/opengv).
Expand All @@ -25,23 +21,3 @@ The code is in the public domain.

* All code in **DBoW2** folder.
This is a modified version of [DBoW2](https://github.com/dorian3d/DBoW2) and [DLib](https://github.com/dorian3d/DLib) library. All files included are BSD licensed.

* All code in **g2o** folder.
This is a modified version of [g2o](https://github.com/RainerKuemmerle/g2o). All files included are BSD licensed.

* All code in **Sophus** folder.
This is a modified version of [Sophus](https://github.com/strasdat/Sophus). [MIT license](https://en.wikipedia.org/wiki/MIT_License).

#####Library dependencies

* **Pangolin (visualization and user interface)**.
[MIT license](https://en.wikipedia.org/wiki/MIT_License).

* **OpenCV**.
BSD license.

* **Eigen3**.
For versions greater than 3.1.1 is MPL2, earlier versions are LGPLv3.

* **ROS (Optional, only if you build Examples/ROS)**.
BSD license. In the manifest.xml the only declared package dependencies are roscpp, tf, sensor_msgs, image_transport, cv_bridge, which are all BSD licensed.
1 change: 1 addition & 0 deletions Examples/EuRoC/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EuRoC_datasets/
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ Viewer.ViewpointY: -0.7
Viewer.ViewpointZ: -1.8
Viewer.ViewpointF: 500.0
Viewer.imageViewScale: 1.0
Viewer.Enable: 0

System.LoadAtlasFromFile: ../stereo_mh01/euroc.atlas
System.SaveAtlasToFile: euroc_second.atlas
System.loopClosing: 1
Loading