Skip to content

Commit 8642af6

Browse files
committed
u
0 parents  commit 8642af6

File tree

193 files changed

+1261415
-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.

193 files changed

+1261415
-0
lines changed

.clang-format

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BasedOnStyle: Google
2+
SortIncludes: false

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
build/
22+
doxygen/
23+
doc/
24+
*~
25+
lib/
26+
*/html/
27+
.ccls-cache/
28+
.cache/
29+
TUM_dataset/
30+
.vscode/
31+
bin/rgbd_tum

CMakeLists.txt

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
project(ORB_SLAM2_DENSE_MAP)
3+
4+
SET(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
5+
6+
IF(NOT CMAKE_BUILD_TYPE)
7+
SET(CMAKE_BUILD_TYPE Debug)
8+
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
9+
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
10+
ENDIF()
11+
12+
SET(CMAKE_BUILD_TYPE Debug)
13+
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
14+
15+
16+
MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})
17+
18+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
20+
21+
# Check C++11 or C++0x support
22+
include(CheckCXXCompilerFlag)
23+
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
24+
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
25+
if(COMPILER_SUPPORTS_CXX11)
26+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
27+
add_definitions(-DCOMPILEDWITHC11)
28+
message(STATUS "Using flag -std=c++11.")
29+
elseif(COMPILER_SUPPORTS_CXX0X)
30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
31+
add_definitions(-DCOMPILEDWITHC0X)
32+
message(STATUS "Using flag -std=c++0x.")
33+
else()
34+
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
35+
endif()
36+
37+
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
38+
39+
find_package(OpenCV 3 QUIET)
40+
if(NOT OpenCV_FOUND)
41+
find_package(OpenCV 2.4.3 QUIET)
42+
if(NOT OpenCV_FOUND)
43+
message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
44+
endif()
45+
endif()
46+
47+
find_package(Eigen3 REQUIRED)
48+
find_package(Pangolin REQUIRED)
49+
# adding for point cloud viewer and mapper
50+
find_package(PCL 1.7 REQUIRED)
51+
message(STATUS "PCL dir: ${PCL_INCLUDE_DIRS}")
52+
53+
54+
include_directories(
55+
${PROJECT_SOURCE_DIR}
56+
${PROJECT_SOURCE_DIR}/include
57+
${EIGEN3_INCLUDE_DIR}
58+
${Pangolin_INCLUDE_DIRS}
59+
${PCL_INCLUDE_DIRS}
60+
)
61+
62+
add_definitions( ${PCL_DEFINITIONS} )
63+
link_directories( ${PCL_LIBRARY_DIRS} )
64+
65+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
66+
67+
add_library(${PROJECT_NAME} SHARED
68+
src/System.cc
69+
src/Tracking.cc
70+
src/LocalMapping.cc
71+
src/LoopClosing.cc
72+
src/ORBextractor.cc
73+
src/ORBmatcher.cc
74+
src/FrameDrawer.cc
75+
src/Converter.cc
76+
src/MapPoint.cc
77+
src/KeyFrame.cc
78+
src/Map.cc
79+
src/MapDrawer.cc
80+
src/Optimizer.cc
81+
src/PnPsolver.cc
82+
src/Frame.cc
83+
src/KeyFrameDatabase.cc
84+
src/Sim3Solver.cc
85+
src/Initializer.cc
86+
src/Viewer.cc
87+
src/PointCloudMapping.cc
88+
)
89+
90+
target_link_libraries(${PROJECT_NAME}
91+
${OpenCV_LIBS}
92+
${EIGEN3_LIBS}
93+
${Pangolin_LIBRARIES}
94+
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
95+
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
96+
${PCL_LIBRARIES}
97+
)
98+
99+
# 将可执行文件输出到bin
100+
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
101+
102+
add_executable(rgbd_tum
103+
Examples/RGB-D/rgbd_tum.cc)
104+
target_link_libraries(rgbd_tum ${PROJECT_NAME})

CameraTrajectory1.txt

+2,488
Large diffs are not rendered by default.

CameraTrajectory2.txt

+182
Large diffs are not rendered by default.

Dependencies.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
* **ROS (Optional, only if you build Examples/ROS)**.
40+
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.
41+
42+
43+
44+

Examples/RGB-D/TUM1.yaml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
%YAML:1.0
2+
3+
#--------------------------------------------------------------------------------------------
4+
# Camera Parameters. Adjust them!
5+
#--------------------------------------------------------------------------------------------
6+
7+
# Camera calibration and distortion parameters (OpenCV)
8+
Camera.fx: 517.306408
9+
Camera.fy: 516.469215
10+
Camera.cx: 318.643040
11+
Camera.cy: 255.313989
12+
13+
Camera.k1: 0.262383
14+
Camera.k2: -0.953104
15+
Camera.p1: -0.005358
16+
Camera.p2: 0.002628
17+
Camera.k3: 1.163314
18+
19+
Camera.width: 640
20+
Camera.height: 480
21+
22+
# Camera frames per second
23+
Camera.fps: 30.0
24+
25+
# IR projector baseline times fx (aprox.)
26+
Camera.bf: 40.0
27+
28+
# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
29+
Camera.RGB: 1
30+
31+
# Close/Far threshold. Baseline times.
32+
ThDepth: 40.0
33+
34+
# Deptmap values factor
35+
DepthMapFactor: 5000.0
36+
37+
#--------------------------------------------------------------------------------------------
38+
# ORB Parameters
39+
#--------------------------------------------------------------------------------------------
40+
41+
# ORB Extractor: Number of features per image
42+
ORBextractor.nFeatures: 1000
43+
44+
# ORB Extractor: Scale factor between levels in the scale pyramid
45+
ORBextractor.scaleFactor: 1.2
46+
47+
# ORB Extractor: Number of levels in the scale pyramid
48+
ORBextractor.nLevels: 8
49+
50+
# ORB Extractor: Fast threshold
51+
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
52+
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
53+
# You can lower these values if your images have low contrast
54+
ORBextractor.iniThFAST: 20
55+
ORBextractor.minThFAST: 7
56+
57+
#--------------------------------------------------------------------------------------------
58+
# Viewer Parameters
59+
#--------------------------------------------------------------------------------------------
60+
Viewer.KeyFrameSize: 0.05
61+
Viewer.KeyFrameLineWidth: 1
62+
Viewer.GraphLineWidth: 0.9
63+
Viewer.PointSize:2
64+
Viewer.CameraSize: 0.08
65+
Viewer.CameraLineWidth: 3
66+
Viewer.ViewpointX: 0
67+
Viewer.ViewpointY: -0.7
68+
Viewer.ViewpointZ: -1.8
69+
Viewer.ViewpointF: 500
70+
71+
#--------------------------------------------------------------------------------------------
72+
# 点云显示参数
73+
#--------------------------------------------------------------------------------------------
74+
PointCloudMapping.Resolution: 0.01
75+
meank: 50
76+
thresh: 2.0

Examples/RGB-D/TUM2.yaml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
%YAML:1.0
2+
3+
#--------------------------------------------------------------------------------------------
4+
# Camera Parameters. Adjust them!
5+
#--------------------------------------------------------------------------------------------
6+
7+
# Camera calibration and distortion parameters (OpenCV)
8+
Camera.fx: 520.908620
9+
Camera.fy: 521.007327
10+
Camera.cx: 325.141442
11+
Camera.cy: 249.701764
12+
13+
Camera.k1: 0.231222
14+
Camera.k2: -0.784899
15+
Camera.p1: -0.003257
16+
Camera.p2: -0.000105
17+
Camera.k3: 0.917205
18+
19+
Camera.width: 640
20+
Camera.height: 480
21+
22+
# Camera frames per second
23+
Camera.fps: 30.0
24+
25+
# IR projector baseline times fx (aprox.)
26+
Camera.bf: 40.0
27+
28+
# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
29+
Camera.RGB: 1
30+
31+
# Close/Far threshold. Baseline times.
32+
ThDepth: 40.0
33+
34+
# Deptmap values factor
35+
DepthMapFactor: 5208.0
36+
37+
#--------------------------------------------------------------------------------------------
38+
# ORB Parameters
39+
#--------------------------------------------------------------------------------------------
40+
41+
# ORB Extractor: Number of features per image
42+
ORBextractor.nFeatures: 1000
43+
44+
# ORB Extractor: Scale factor between levels in the scale pyramid
45+
ORBextractor.scaleFactor: 1.2
46+
47+
# ORB Extractor: Number of levels in the scale pyramid
48+
ORBextractor.nLevels: 8
49+
50+
# ORB Extractor: Fast threshold
51+
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
52+
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
53+
# You can lower these values if your images have low contrast
54+
ORBextractor.iniThFAST: 20
55+
ORBextractor.minThFAST: 7
56+
57+
#--------------------------------------------------------------------------------------------
58+
# Viewer Parameters
59+
#--------------------------------------------------------------------------------------------
60+
Viewer.KeyFrameSize: 0.07
61+
Viewer.KeyFrameLineWidth: 1
62+
Viewer.GraphLineWidth: 0.9
63+
Viewer.PointSize:2
64+
Viewer.CameraSize: 0.08
65+
Viewer.CameraLineWidth: 3
66+
Viewer.ViewpointX: 0
67+
Viewer.ViewpointY: -0.7
68+
Viewer.ViewpointZ: -1.8
69+
Viewer.ViewpointF: 500
70+
71+
PointCloudMapping.Resolution: 0.01
72+
meank: 50
73+
thresh: 2.0

0 commit comments

Comments
 (0)