Skip to content

Commit 1e1847b

Browse files
init
0 parents  commit 1e1847b

File tree

269 files changed

+124702
-0
lines changed

Some content is hidden

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

269 files changed

+124702
-0
lines changed

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
CMakeLists.txt.user
2+
Examples/Monocular/mono_euroc
3+
Examples/Monocular/mono_kitti
4+
Examples/Monocular/mono_tum
5+
Examples/RGB-D/rgbd_tum
6+
Examples/ROS/ORB_SLAM2/CMakeLists.txt.user
7+
Examples/ROS/ORB_SLAM2/Mono
8+
Examples/ROS/ORB_SLAM2/MonoAR
9+
Examples/ROS/ORB_SLAM2/RGBD
10+
Examples/ROS/ORB_SLAM2/Stereo
11+
Examples/ROS/ORB_SLAM2/build/
12+
Examples/Stereo/stereo_euroc
13+
Examples/Stereo/stereo_kitti
14+
KeyFrameTrajectory.txt
15+
Thirdparty/DBoW2/build/
16+
Thirdparty/DBoW2/lib/
17+
Thirdparty/g2o/build/
18+
Thirdparty/g2o/config.h
19+
Thirdparty/g2o/lib/
20+
Vocabulary/ORBvoc.txt
21+
Vocabulary/bin_vocabulary
22+
build/
23+
*~
24+
lib/
25+
.idea/
26+
27+
**/build/*
28+
**/lib/*
29+
*.kdev4
30+
**/KeyFrameTrajectory.txt
31+
**/KeyFrameNavStateTrajectory.txt
32+
*.autosave
33+
**/tmp/*
34+
**/debug.txt
35+
**.tags
36+
**.tags_sorted_by_file
37+
**/build*/*
38+
.tags
39+
.tags_sorted_by_file
40+
41+
42+
43+

CMakeLists.txt

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
project(ORB_SLAM2)
3+
4+
IF(NOT CMAKE_BUILD_TYPE)
5+
SET(CMAKE_BUILD_TYPE Release)
6+
ENDIF()
7+
8+
MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})
9+
10+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
11+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
12+
13+
# Check C++11 or C++0x support
14+
include(CheckCXXCompilerFlag)
15+
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
16+
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
17+
if(COMPILER_SUPPORTS_CXX11)
18+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
19+
add_definitions(-DCOMPILEDWITHC11)
20+
message(STATUS "Using flag -std=c++11.")
21+
elseif(COMPILER_SUPPORTS_CXX0X)
22+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
23+
add_definitions(-DCOMPILEDWITHC0X)
24+
message(STATUS "Using flag -std=c++0x.")
25+
else()
26+
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
27+
endif()
28+
29+
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
30+
31+
find_package(OpenCV 3.0 QUIET)
32+
if(NOT OpenCV_FOUND)
33+
find_package(OpenCV 2.4.3 QUIET)
34+
if(NOT OpenCV_FOUND)
35+
message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
36+
endif()
37+
endif()
38+
39+
find_package(Eigen3 3.1.0 REQUIRED)
40+
find_package(Pangolin REQUIRED)
41+
find_package(Cholmod REQUIRED)
42+
43+
include_directories(
44+
${PROJECT_SOURCE_DIR}
45+
${PROJECT_SOURCE_DIR}/include
46+
${PROJECT_SOURCE_DIR}/src
47+
${EIGEN3_INCLUDE_DIR}
48+
${Pangolin_INCLUDE_DIRS}
49+
${CHOLMOD_INCLUDE_DIR}
50+
)
51+
52+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
53+
54+
add_library(${PROJECT_NAME} SHARED
55+
src/System.cc
56+
src/Tracking.cc
57+
src/LocalMapping.cc
58+
src/LoopClosing.cc
59+
src/ORBextractor.cc
60+
src/ORBmatcher.cc
61+
src/FrameDrawer.cc
62+
src/Converter.cc
63+
src/MapPoint.cc
64+
src/KeyFrame.cc
65+
src/Map.cc
66+
src/MapDrawer.cc
67+
src/Optimizer.cc
68+
src/PnPsolver.cc
69+
src/Frame.cc
70+
src/KeyFrameDatabase.cc
71+
src/Sim3Solver.cc
72+
src/Initializer.cc
73+
src/Viewer.cc
74+
75+
include/Frame.h
76+
include/KeyFrame.h
77+
include/Tracking.h
78+
include/LocalMapping.h
79+
80+
src/IMU/configparam.h
81+
src/IMU/configparam.cpp
82+
83+
src/IMU/imudata.h
84+
src/IMU/imudata.cpp
85+
src/IMU/IMUPreintegrator.h
86+
src/IMU/IMUPreintegrator.cpp
87+
src/IMU/so3.cpp
88+
src/IMU/so3.h
89+
src/IMU/NavState.h
90+
src/IMU/NavState.cpp
91+
92+
src/IMU/g2otypes.h
93+
src/IMU/g2otypes.cpp
94+
)
95+
96+
target_link_libraries(${PROJECT_NAME}
97+
${OpenCV_LIBS}
98+
${EIGEN3_LIBS}
99+
${Pangolin_LIBRARIES}
100+
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
101+
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
102+
cholmod
103+
${CHOLMOD_LIBRARIES}
104+
${BLAS_LIBRARIES}
105+
${LAPACK_LIBRARIES}
106+
)
107+
108+
## Build examples
109+
110+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/RGB-D)
111+
112+
add_executable(rgbd_tum
113+
Examples/RGB-D/rgbd_tum.cc)
114+
target_link_libraries(rgbd_tum ${PROJECT_NAME})
115+
116+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Stereo)
117+
118+
add_executable(stereo_kitti
119+
Examples/Stereo/stereo_kitti.cc)
120+
target_link_libraries(stereo_kitti ${PROJECT_NAME})
121+
122+
add_executable(stereo_euroc
123+
Examples/Stereo/stereo_euroc.cc)
124+
target_link_libraries(stereo_euroc ${PROJECT_NAME})
125+
126+
add_executable(stereo_euroc_VI
127+
Examples/Stereo/stereo_euroc_VI.cc)
128+
target_link_libraries(stereo_euroc_VI ${PROJECT_NAME})
129+
130+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Monocular)
131+
132+
add_executable(mono_tum
133+
Examples/Monocular/mono_tum.cc)
134+
target_link_libraries(mono_tum ${PROJECT_NAME})
135+
136+
add_executable(mono_kitti
137+
Examples/Monocular/mono_kitti.cc)
138+
target_link_libraries(mono_kitti ${PROJECT_NAME})
139+
140+
add_executable(mono_euroc
141+
Examples/Monocular/mono_euroc.cc)
142+
target_link_libraries(mono_euroc ${PROJECT_NAME})
143+
144+
add_executable(mono_euroc_VI
145+
Examples/Monocular/mono_euroc_VI.cc)
146+
target_link_libraries(mono_euroc_VI ${PROJECT_NAME})
147+
148+
## Build tools
149+
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Vocabulary)
150+
#add_executable(bin_vocabulary
151+
#Vocabulary/bin_vocabulary.cc)
152+
#target_link_libraries(bin_vocabulary ${PROJECT_NAME})

Dependencies.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
##List of Known Dependencies
2+
###ORB-SLAM2 version 1.0
3+
4+
In this document we list all the pieces of code included by ORB-SLAM2 and linked libraries which are not property of the authors of ORB-SLAM2.
5+
6+
7+
#####Code in **src** and **include** folders
8+
9+
* *ORBextractor.cc*.
10+
This is a modified version of orb.cpp of OpenCV library. The original code is BSD licensed.
11+
12+
* *PnPsolver.h, PnPsolver.cc*.
13+
This is a modified version of the epnp.h and epnp.cc of Vincent Lepetit.
14+
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.
15+
16+
* Function *ORBmatcher::DescriptorDistance* in *ORBmatcher.cc*.
17+
The code is from: http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel.
18+
The code is in the public domain.
19+
20+
#####Code in Thirdparty folder
21+
22+
* All code in **DBoW2** folder.
23+
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.
24+
25+
* All code in **g2o** folder.
26+
This is a modified version of [g2o](https://github.com/RainerKuemmerle/g2o). All files included are BSD licensed.
27+
28+
#####Library dependencies
29+
30+
* **Pangolin (visualization and user interface)**.
31+
[MIT license](https://en.wikipedia.org/wiki/MIT_License).
32+
33+
* **OpenCV**.
34+
BSD license.
35+
36+
* **Eigen3**.
37+
For versions greater than 3.1.1 is MPL2, earlier versions are LGPLv3.
38+
39+
* **BLAS** (required by g2o).
40+
[Freely-available software](http://www.netlib.org/blas/#_licensing).
41+
42+
* **LAPACK**(required by g2o).
43+
BSD license.
44+
45+
* **ROS (Optional, only if you build Examples/ROS)**.
46+
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.
47+
48+
49+
50+

Examples/Monocular/EuRoC.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
%YAML:1.0
2+
3+
#--------------------------------------------------------------------------------------------
4+
# Camera Parameters. Adjust them!
5+
#--------------------------------------------------------------------------------------------
6+
7+
# Camera calibration and distortion parameters (OpenCV)
8+
Camera.fx: 458.654
9+
Camera.fy: 457.296
10+
Camera.cx: 367.215
11+
Camera.cy: 248.375
12+
13+
Camera.k1: -0.28340811
14+
Camera.k2: 0.07395907
15+
Camera.p1: 0.00019359
16+
Camera.p2: 1.76187114e-05
17+
18+
# Camera frames per second
19+
Camera.fps: 20.0
20+
21+
# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
22+
Camera.RGB: 1
23+
24+
#--------------------------------------------------------------------------------------------
25+
# ORB Parameters
26+
#--------------------------------------------------------------------------------------------
27+
28+
# ORB Extractor: Number of features per image
29+
ORBextractor.nFeatures: 1000
30+
31+
# ORB Extractor: Scale factor between levels in the scale pyramid
32+
ORBextractor.scaleFactor: 1.2
33+
34+
# ORB Extractor: Number of levels in the scale pyramid
35+
ORBextractor.nLevels: 8
36+
37+
# ORB Extractor: Fast threshold
38+
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
39+
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
40+
# You can lower these values if your images have low contrast
41+
ORBextractor.iniThFAST: 20
42+
ORBextractor.minThFAST: 7
43+
44+
#--------------------------------------------------------------------------------------------
45+
# Viewer Parameters
46+
#---------------------------------------------------------------------------------------------
47+
Viewer.KeyFrameSize: 0.05
48+
Viewer.KeyFrameLineWidth: 1
49+
Viewer.GraphLineWidth: 0.9
50+
Viewer.PointSize:2
51+
Viewer.CameraSize: 0.08
52+
Viewer.CameraLineWidth: 3
53+
Viewer.ViewpointX: 0
54+
Viewer.ViewpointY: -0.7
55+
Viewer.ViewpointZ: -1.8
56+
Viewer.ViewpointF: 500
57+

0 commit comments

Comments
 (0)