Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ORB_SLAM3 for in-source build #38

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: |
echo "/usr/local/cuda-11.0/bin" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: local dependencies cache
- name: cache local dependencies
id: cache-local
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -134,6 +134,12 @@ jobs:
- name: format check
run: make check-format
working-directory: build
- name: cache third party build
id: cache-third-party
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/build/third_party
key: third-party-build-v1.0
- name: build
run: make -j3
working-directory: build
5 changes: 4 additions & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ add_library(popl INTERFACE)
target_include_directories(popl SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/popl/include)

add_subdirectory(imgui-1.77)
#add_subdirectory(spdlog-1.6.1)
add_subdirectory(googletest-1.10.0)
add_subdirectory(ORB_SLAM3)

# NOTE(alvin): add back when OpenVSLAM is removed
# add_subdirectory(spdlog-1.6.1)
49 changes: 49 additions & 0 deletions third_party/ORB_SLAM3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
CMakeLists.txt.user
CMakeLists_modified.txt

Examples/RGB-D/rgbd_tum

Examples/Monocular/mono_euroc
Examples/Monocular/mono_kitti
Examples/Monocular/mono_tum
Examples/Monocular/mono_tum_vi

Examples/Stereo/stereo_euroc
Examples/Stereo/stereo_kitti
Examples/Stereo/stereo_tum_vi

Examples/Monocular-Inertial/mono_inertial_euroc
Examples/Monocular-Inertial/mono_inertial_tum_vi

Examples/Stereo-Inertial/stereo_inertial_euroc
Examples/Stereo-Inertial/stereo_inertial_tum_vi

Examples/ROS/ORB_SLAM3/Mono
Examples/ROS/ORB_SLAM3/Mono_Inertial
Examples/ROS/ORB_SLAM3/MonoAR
Examples/ROS/ORB_SLAM3/RGBD
Examples/ROS/ORB_SLAM3/Stereo
Examples/ROS/ORB_SLAM3/Stereo_Inertial

Examples/ROS/ORB_SLAM3/CMakeLists.txt.user
Examples/ROS/ORB_SLAM3/build/

KeyFrameTrajectory.txt
CameraTrajectory.txt
kf_*.txt
f_*.txt
Thirdparty/DBoW2/build/
Thirdparty/DBoW2/lib/
Thirdparty/g2o/build/
Thirdparty/g2o/config.h
Thirdparty/g2o/lib/
Vocabulary/ORBvoc.txt
build/

lib/

cmake_modules/
cmake-build-debug/

*.pyc
*.osa
120 changes: 120 additions & 0 deletions third_party/ORB_SLAM3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
cmake_minimum_required(VERSION 2.8)
project(ORB_SLAM3)

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

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

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -march=native")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)

find_package(OpenCV REQUIRED)

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

find_package(Eigen3 3.3 REQUIRED)
find_package(Pangolin REQUIRED)

add_library(${PROJECT_NAME} SHARED
src/System.cc
src/Tracking.cc
src/LocalMapping.cc
src/LoopClosing.cc
src/ORBextractor.cc
src/ORBmatcher.cc
src/FrameDrawer.cc
src/Converter.cc
src/MapPoint.cc
src/KeyFrame.cc
src/Atlas.cc
src/Map.cc
src/MapDrawer.cc
src/Optimizer.cc
src/PnPsolver.cc
src/Frame.cc
src/KeyFrameDatabase.cc
src/Sim3Solver.cc
src/Initializer.cc
src/Viewer.cc
src/ImuTypes.cc
src/G2oTypes.cc
src/CameraModels/Pinhole.cpp
src/CameraModels/KannalaBrandt8.cpp
src/OptimizableTypes.cpp
src/MLPnPsolver.cpp
include/System.h
include/Tracking.h
include/LocalMapping.h
include/LoopClosing.h
include/ORBextractor.h
include/ORBmatcher.h
include/FrameDrawer.h
include/Converter.h
include/MapPoint.h
include/KeyFrame.h
include/Atlas.h
include/Map.h
include/MapDrawer.h
include/Optimizer.h
include/PnPsolver.h
include/Frame.h
include/KeyFrameDatabase.h
include/Sim3Solver.h
include/Initializer.h
include/Viewer.h
include/ImuTypes.h
include/G2oTypes.h
include/CameraModels/GeometricCamera.h
include/CameraModels/Pinhole.h
include/CameraModels/KannalaBrandt8.h
include/OptimizableTypes.h
include/MLPnPsolver.h
include/TwoViewReconstruction.h
src/TwoViewReconstruction.cc)

add_subdirectory(Thirdparty/DBoW2)
add_subdirectory(Thirdparty/g2o)

target_include_directories(${PROJECT_NAME} PUBLIC
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/CameraModels
${Pangolin_INCLUDE_DIRS}
)


target_link_libraries(${PROJECT_NAME} PUBLIC
${OpenCV_LIBS}
${Pangolin_LIBRARIES}
Eigen3::Eigen
DBoW2
g2o
)

target_compile_definitions(${PROJECT_NAME} PRIVATE COMPILEDWITHC11)

target_compile_options(${PROJECT_NAME} PRIVATE
-Wno-deprecated-declarations
-Wno-deprecated
-Wno-dangling-else
-Wno-sign-compare
-Wno-unused-variable
-Wno-unused-but-set-variable
-Wno-unused-local-typedefs
-Wno-unused-result
-Wno-maybe-uninitialized
-Wno-conversion-null
-Wno-comment
-Wno-reorder
)

26 changes: 26 additions & 0 deletions third_party/ORB_SLAM3/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ORB-SLAM3
Details of changes between the different versions.

### V0.3: Beta version, 4 Sep 2020

- RGB-D compatibility, the RGB-D examples had been adapted to the new version.

- Kitti and TUM dataset compatibility, these examples had been adapted to the new version.

- ROS compatibility, It had been updated the old references in the code to work with this version.

- Config file parser, the YAML file contains the session configuration, a wrong parametrization may break the execution without any information to solve it. This version parses the file to read all the fields and give a proper answer if one of the fields have been wrong deffined or don't exist.

- Fixed minor bugs.


### V0.2: Beta version, 7 Aug 2020
Initial release. It has these capabilities:

- Multiple-Maps capabilities, it is able to handle multiple maps in the same session and merge them when a common area is detected with a seamless fussion.

- Inertial sensor, the IMU initialization takes a 2 seconds to achieve a scale error less than 5\% and it is reffined in the next 10 seconds until is around 1\%. Inertial measures are integrated at frame rate to estimate the scale, gravity and velocity in order to improve the visual features detection and make the system robust to temporal occlusions.

- Fisheye sensor, the fisheye sensors are now fully supported in monocular and stereo.


48 changes: 48 additions & 0 deletions third_party/ORB_SLAM3/Dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
##List of Known Dependencies
###ORB-SLAM3 version 0.3

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

* *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.

* *MLPnPsolver.h, MLPnPsolver.cc*.
This is a modified version of the MLPnP of Steffen Urban from [here](https://github.com/urbste/opengv).
The original code is BSD licensed.

* Function *ORBmatcher::DescriptorDistance* in *ORBmatcher.cc*.
The code is from: http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel.
The code is in the public domain.

#####Code in Thirdparty folder

* 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.

#####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.




Loading