Skip to content

Commit 2cbcb40

Browse files
update
1 parent 01d0366 commit 2cbcb40

File tree

215 files changed

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

215 files changed

+51386
-0
lines changed

CMakeLists.txt

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
project(Jetson-SLAM)
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+
30+
find_package(CUDA REQUIRED)
31+
32+
33+
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
34+
35+
find_package(OpenCV 3.0 QUIET)
36+
if(NOT OpenCV_FOUND)
37+
message(FATAL_ERROR "OpenCV >= 3 not found.")
38+
endif()
39+
40+
find_package(Eigen3 3.1.0 REQUIRED)
41+
find_package(Pangolin REQUIRED)
42+
43+
include_directories(
44+
${PROJECT_SOURCE_DIR}
45+
${PROJECT_SOURCE_DIR}/include
46+
${EIGEN3_INCLUDE_DIR}
47+
${Pangolin_INCLUDE_DIRS}
48+
${CUDA_INCLUDE_DIRS}
49+
)
50+
51+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
52+
53+
54+
cuda_add_library(${PROJECT_NAME} SHARED
55+
src/Converter.cc
56+
src/Frame.cc
57+
src/FrameDrawer.cc
58+
src/Initializer.cc
59+
src/KeyFrame.cc
60+
src/KeyFrameDatabase.cc
61+
src/LocalMapping.cc
62+
src/LoopClosing.cc
63+
src/Map.cc
64+
src/MapDrawer.cc
65+
src/MapPoint.cc
66+
src/Optimizer.cc
67+
src/ORBextractor.cc
68+
src/ORBmatcher.cc
69+
src/PnPsolver.cc
70+
src/Sim3Solver.cc
71+
src/System.cc
72+
src/Tracking.cc
73+
src/Viewer.cc
74+
src/cuda/orb_bitpattern.cpp
75+
src/cuda/orb_copy_output.cu
76+
src/cuda/orb_descriptor.cu
77+
src/cuda/orb_FAST_apply_NMS_G.cu
78+
src/cuda/orb_FAST_apply_NMS_L.cu
79+
src/cuda/orb_FAST_apply_NMS_MS.cpp
80+
src/cuda/orb_FAST_apply_NMS_MS.cu
81+
src/cuda/orb_FAST_compute_score.cu
82+
src/cuda/orb_FAST_obtain_keypoints.cpp
83+
src/cuda/orb_FAST_orientation.cu
84+
src/cuda/orb_gaussian.cu
85+
src/cuda/orb_gpu.cpp
86+
src/cuda/orb_matcher.cu
87+
src/cuda/orb_pyramid.cu
88+
src/cuda/orb_stereo_match.cu
89+
src/cuda/synced_mem_holder.cpp
90+
src/cuda/tracking_isinfrustum.cu
91+
)
92+
93+
target_link_libraries(${PROJECT_NAME}
94+
${OpenCV_LIBS}
95+
${EIGEN3_LIBS}
96+
${Pangolin_LIBRARIES}
97+
${CUDA_LIBRARIES}
98+
${CUDA_CUBLAS_LIBRARIES}
99+
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
100+
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
101+
)
102+
103+
# Build execs
104+
105+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/execs)
106+
107+
add_executable(stereo_kitti execs/stereo_kitti.cc)
108+
target_link_libraries(stereo_kitti ${PROJECT_NAME})
109+
110+
add_executable(stereo_euroc execs/stereo_euroc.cc)
111+
target_link_libraries(stereo_euroc ${PROJECT_NAME})
112+
113+
add_executable(stereo_kaistvio execs/stereo_kaistvio.cc)
114+
target_link_libraries(stereo_kaistvio ${PROJECT_NAME})
115+
116+
add_executable(stereo_live execs/stereo_live.cpp)
117+
target_link_libraries(stereo_live ${PROJECT_NAME})
118+
119+

README.md

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Jetson-SLAM
2+
**More updates coming soon**
3+
4+
**To be done:**
5+
1. Update exec folder
6+
7+
8+
**The frontend of Jetson-SLAM will be released as a separate repository as-well.**
9+
10+
**Authors:** Ashish Kumar
11+
12+
![Jetson-SLAM Design](/assets/img/jetson-slam.png "Jetson-SLAM")
13+
14+
This repository contains Jetson-SLAM with [FULL-BA back-end](https://128.84.21.199/pdf/1610.06475.pdf)
15+
Jetson-SLAM is a GPU-thrusted real-time SLAM library for **Monocular**, **Stereo** and **RGB-D** cameras. It can run very high speeds beyond **500FPS** on RTX-2070 and Beyond **90FPS** on Jetson-NX **@320x240** resolution. Please see the [Jetson-SLAM Paper](https://drive.google.com/file/d/1KagYH0YVSDOeBwv4oHyKrmndOF7Sc_TV/view?usp=drive_link) for rigorous results over different resolutions, GPUs and comparison with existing VO/VIO/SLAM pipelines.
16+
17+
**Jetson-SLAM can run alongside Deep Neural Networks. It is fully behchmarked with VGG**
18+
19+
# Video
20+
<p align="center">
21+
<a href="https://drive.google.com/file/d/16FN0FKy76R6MBdu44WzHyH3KstruOeJT/view?usp=drive_link" target="_blank" ><img align="center" src="/assets/img/video_thumbnail.png"
22+
alt="Jetson-SLAM" width="70%" height="70%" border="0" /></a>
23+
</p>
24+
25+
<div>
26+
<p align="center">
27+
<img align="center" src="/assets/gif/kaistvio_circle.gif"
28+
alt="Jetson-SLAM" width="50%" height="50%" border="0" />
29+
</p>
30+
31+
32+
# Main Highlight
33+
34+
<p align="center">
35+
<img align="center" src="/assets/img/fig1.png"
36+
alt="Jetson-SLAM" width="70%" height="70%" border="0" />
37+
38+
# 1. Main Results
39+
40+
### Datasets
41+
1. [KITTI-Benchmark](https://github.com/zinuok/VINS-MONO)
42+
43+
2. [EuRoC Benchmark](https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets)
44+
45+
3. [KAIST-VIO Benchmark](https://github.com/url-kaist/kaistviodataset)
46+
47+
48+
#### Results on KITTI Benchmark
49+
![Results on KITTI Benchmark](/assets/img/kitti_plot.png)
50+
51+
![KITTI Trajectories](/assets/img/kitti_traj.png)
52+
53+
54+
#### Results on EuRoC Benchmark
55+
![Results on EuRoC Benchmark](/assets/img/euroc_plot.png)
56+
57+
![Results on EuRoC Benchmark](/assets/img/euroc_table.png)
58+
59+
![EuRoC Trajectories](/assets/img/euroc_traj.png)
60+
61+
62+
#### Results on KAIST-VIO Benchmark
63+
![Results on KAIST-VIO Benchmark](/assets/img/kaistvio_table.png)
64+
65+
![KAIST-VIO Trajectories](/assets/img/kaistvio_traj.png)
66+
67+
#### Performance with scaled versions of VGG-16 Co-existing on Jetson-NX
68+
![Co-exating VGG performance](/assets/img/vgg.png)
69+
70+
71+
### Build Instructions
72+
73+
**Step-1**
74+
Install the dependencies given below:
75+
76+
1. OpenCV 3
77+
2. Eigen3
78+
3. CUDA
79+
4. Pangolin
80+
81+
82+
**Step-2**
83+
Run build.sh
84+
85+
### Run Instructions
86+
87+
Go to execs and run Jetson-SLAM on following choices:
88+
1. Run stereo_kitti for KITTI-Benchmark
89+
2. Run stereo_euroc for EuRoC Benchmark
90+
3. Run stereo_kaistvio for KAIST-VIO Benchmark
91+
4. Run stereo_live for live images from a Stereo-Rig. Please customize the "stereo_live_config.yaml" file for your stereo rig.
92+
93+
94+
95+
### License
96+
97+
Jetson-SLAM is released under a [GPLv3 license].
98+
99+
### Bibtex citation:
100+
101+
@article{Jetson-SLAM,
102+
title={{High-Speed Stereo Visual-{SLAM} For Low-Powered Computing Devices},
103+
author={Kumar, Ashish and Park, Jaesik and Behera, Laxmidhar},
104+
year={2023},
105+
}
106+

Thirdparty/DBoW2/CMakeLists.txt

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
project(DBoW2)
3+
4+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
5+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
6+
7+
set(HDRS_DBOW2
8+
DBoW2/BowVector.h
9+
DBoW2/FORB.h
10+
DBoW2/FClass.h
11+
DBoW2/FeatureVector.h
12+
DBoW2/ScoringObject.h
13+
DBoW2/TemplatedVocabulary.h)
14+
set(SRCS_DBOW2
15+
DBoW2/BowVector.cpp
16+
DBoW2/FORB.cpp
17+
DBoW2/FeatureVector.cpp
18+
DBoW2/ScoringObject.cpp)
19+
20+
set(HDRS_DUTILS
21+
DUtils/Random.h
22+
DUtils/Timestamp.h)
23+
set(SRCS_DUTILS
24+
DUtils/Random.cpp
25+
DUtils/Timestamp.cpp)
26+
27+
find_package(OpenCV 3.0 QUIET)
28+
if(NOT OpenCV_FOUND)
29+
find_package(OpenCV 2.4.3 QUIET)
30+
if(NOT OpenCV_FOUND)
31+
message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
32+
endif()
33+
endif()
34+
35+
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
36+
37+
include_directories(${OpenCV_INCLUDE_DIRS})
38+
add_library(DBoW2 SHARED ${SRCS_DBOW2} ${SRCS_DUTILS})
39+
target_link_libraries(DBoW2 ${OpenCV_LIBS})
40+

Thirdparty/DBoW2/DBoW2/BowVector.cpp

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/**
2+
* File: BowVector.cpp
3+
* Date: March 2011
4+
* Author: Dorian Galvez-Lopez
5+
* Description: bag of words vector
6+
* License: see the LICENSE.txt file
7+
*
8+
*/
9+
10+
#include <iostream>
11+
#include <fstream>
12+
#include <vector>
13+
#include <algorithm>
14+
#include <cmath>
15+
16+
#include "BowVector.h"
17+
18+
namespace DBoW2 {
19+
20+
// --------------------------------------------------------------------------
21+
22+
BowVector::BowVector(void)
23+
{
24+
}
25+
26+
// --------------------------------------------------------------------------
27+
28+
BowVector::~BowVector(void)
29+
{
30+
}
31+
32+
// --------------------------------------------------------------------------
33+
34+
void BowVector::addWeight(WordId id, WordValue v)
35+
{
36+
BowVector::iterator vit = this->lower_bound(id);
37+
38+
if(vit != this->end() && !(this->key_comp()(id, vit->first)))
39+
{
40+
vit->second += v;
41+
}
42+
else
43+
{
44+
this->insert(vit, BowVector::value_type(id, v));
45+
}
46+
}
47+
48+
// --------------------------------------------------------------------------
49+
50+
void BowVector::addIfNotExist(WordId id, WordValue v)
51+
{
52+
BowVector::iterator vit = this->lower_bound(id);
53+
54+
if(vit == this->end() || (this->key_comp()(id, vit->first)))
55+
{
56+
this->insert(vit, BowVector::value_type(id, v));
57+
}
58+
}
59+
60+
// --------------------------------------------------------------------------
61+
62+
void BowVector::normalize(LNorm norm_type)
63+
{
64+
double norm = 0.0;
65+
BowVector::iterator it;
66+
67+
if(norm_type == DBoW2::L1)
68+
{
69+
for(it = begin(); it != end(); ++it)
70+
norm += fabs(it->second);
71+
}
72+
else
73+
{
74+
for(it = begin(); it != end(); ++it)
75+
norm += it->second * it->second;
76+
norm = sqrt(norm);
77+
}
78+
79+
if(norm > 0.0)
80+
{
81+
for(it = begin(); it != end(); ++it)
82+
it->second /= norm;
83+
}
84+
}
85+
86+
// --------------------------------------------------------------------------
87+
88+
std::ostream& operator<< (std::ostream &out, const BowVector &v)
89+
{
90+
BowVector::const_iterator vit;
91+
std::vector<unsigned int>::const_iterator iit;
92+
unsigned int i = 0;
93+
const unsigned int N = v.size();
94+
for(vit = v.begin(); vit != v.end(); ++vit, ++i)
95+
{
96+
out << "<" << vit->first << ", " << vit->second << ">";
97+
98+
if(i < N-1) out << ", ";
99+
}
100+
return out;
101+
}
102+
103+
// --------------------------------------------------------------------------
104+
105+
void BowVector::saveM(const std::string &filename, size_t W) const
106+
{
107+
std::fstream f(filename.c_str(), std::ios::out);
108+
109+
WordId last = 0;
110+
BowVector::const_iterator bit;
111+
for(bit = this->begin(); bit != this->end(); ++bit)
112+
{
113+
for(; last < bit->first; ++last)
114+
{
115+
f << "0 ";
116+
}
117+
f << bit->second << " ";
118+
119+
last = bit->first + 1;
120+
}
121+
for(; last < (WordId)W; ++last)
122+
f << "0 ";
123+
124+
f.close();
125+
}
126+
127+
// --------------------------------------------------------------------------
128+
129+
} // namespace DBoW2
130+

0 commit comments

Comments
 (0)