# ORB-SLAM2
We provide a script `build.sh` to build the *Thirdparty* libraries and *ORB-SLAM2*. Please make sure you have installed all required dependencies (see section 2). Execute:
```
cd 项目
chmod +x build.sh
./build.sh
```
This will create **libORB_SLAM2.so** at *lib* folder and the executables **mono_tum**, **mono_kitti**, **rgbd_tum**, **stereo_kitti**, **mono_euroc** and **stereo_euroc** in *Examples* folder.
# 4. Monocular Examples
## TUM Dataset
1. Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
2. Execute the following command. Change `TUMX.yaml` to TUM1.yaml,TUM2.yaml or TUM3.yaml for freiburg1, freiburg2 and freiburg3 sequences respectively. Change `PATH_TO_SEQUENCE_FOLDER`to the uncompressed sequence folder.
```
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
```
## KITTI Dataset
1. Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php
2. Execute the following command. Change `KITTIX.yaml`by KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. Change `PATH_TO_DATASET_FOLDER` to the uncompressed dataset folder. Change `SEQUENCE_NUMBER` to 00, 01, 02,.., 11.
```
./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
```
## EuRoC Dataset
1. Download a sequence (ASL format) from http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
2. Execute the following first command for V1 and V2 sequences, or the second command for MH sequences. Change PATH_TO_SEQUENCE_FOLDER and SEQUENCE according to the sequence you want to run.
```
./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE_FOLDER/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
```
```
./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
```
# 5. Stereo Examples
## KITTI Dataset
1. Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php
2. Execute the following command. Change `KITTIX.yaml`to KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. Change `PATH_TO_DATASET_FOLDER` to the uncompressed dataset folder. Change `SEQUENCE_NUMBER` to 00, 01, 02,.., 11.
```
./Examples/Stereo/stereo_kitti Vocabulary/ORBvoc.txt Examples/Stereo/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
```
## EuRoC Dataset
1. Download a sequence (ASL format) from http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
2. Execute the following first command for V1 and V2 sequences, or the second command for MH sequences. Change PATH_TO_SEQUENCE_FOLDER and SEQUENCE according to the sequence you want to run.
```
./Examples/Stereo/stereo_euroc Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml PATH_TO_SEQUENCE/mav0/cam0/data PATH_TO_SEQUENCE/mav0/cam1/data Examples/Stereo/EuRoC_TimeStamps/SEQUENCE.txt
```
```
./Examples/Stereo/stereo_euroc Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml PATH_TO_SEQUENCE/cam0/data PATH_TO_SEQUENCE/cam1/data Examples/Stereo/EuRoC_TimeStamps/SEQUENCE.txt
```
# 6. RGB-D Example
## TUM Dataset
1. Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
2. Associate RGB images and depth images using the python script [associate.py](http://vision.in.tum.de/data/datasets/rgbd-dataset/tools). We already provide associations for some of the sequences in *Examples/RGB-D/associations/*. You can generate your own associations file executing:
```
python associate.py PATH_TO_SEQUENCE/rgb.txt PATH_TO_SEQUENCE/depth.txt > associations.txt
```
3. Execute the following command. Change `TUMX.yaml` to TUM1.yaml,TUM2.yaml or TUM3.yaml for freiburg1, freiburg2 and freiburg3 sequences respectively. Change `PATH_TO_SEQUENCE_FOLDER`to the uncompressed sequence folder. Change `ASSOCIATIONS_FILE` to the path to the corresponding associations file.
```
./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUMX.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS_FILE
```
# 7. ROS Examples
### Building the nodes for mono, monoAR, stereo and RGB-D
1. Add the path including *Examples/ROS/ORB_SLAM2* to the ROS_PACKAGE_PATH environment variable. Open .bashrc file and add at the end the following line. Replace PATH by the folder where you cloned ORB_SLAM2:
```
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM2/Examples/ROS
```
2. Execute `build_ros.sh` script:
```
chmod +x build_ros.sh
./build_ros.sh
```
### Running Monocular Node
For a monocular input from topic `/camera/image_raw` run node ORB_SLAM2/Mono. You will need to provide the vocabulary file and a settings file. See the monocular examples above.
```
rosrun ORB_SLAM2 Mono PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
```
### Running Monocular Augmented Reality Demo
This is a demo of augmented reality where you can use an interface to insert virtual cubes in planar regions of the scene.
The node reads images from topic `/camera/image_raw`.
```
rosrun ORB_SLAM2 MonoAR PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
```
### Running Stereo Node
For a stereo input from topic `/camera/left/image_raw` and `/camera/right/image_raw` run node ORB_SLAM2/Stereo. You will need to provide the vocabulary file and a settings file. If you **provide rectification matrices** (see Examples/Stereo/EuRoC.yaml example), the node will recitify the images online, **otherwise images must be pre-rectified**.
```
rosrun ORB_SLAM2 Stereo PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE ONLINE_RECTIFICATION
```
**Example**: Download a rosbag (e.g. V1_01_easy.bag) from the EuRoC dataset (http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets). Open 3 tabs on the terminal and run the following command at each tab:
```
roscore
```
```
rosrun ORB_SLAM2 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml true
```
```
rosbag play --pause V1_01_easy.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw
```
Once ORB-SLAM2 has loaded the vocabulary, press space in the rosbag tab. Enjoy!. Note: a powerful computer is required to run the most exigent sequences of this dataset.
### Running RGB_D Node
For an RGB-D input from topics `/camera/rgb/image_raw` and `/camera/depth_registered/image_raw`, run node ORB_SLAM2/RGBD. You will need to provide the vocabulary file and a settings file. See the RGB-D example above.
```
rosrun ORB_SLAM2 RGBD PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
```
# 8. Processing your own sequences
You will need to create a settings file with the calibration of your camera. See the settings file provided for the TUM and KITTI datasets for monocular, stereo and RGB-D cameras. We use the calibration model of OpenCV. See the examples to learn how to create a program that makes use of the ORB-SLAM2 library and how to pass images to the SLAM system. Stereo input must be synchronized and rectified. RGB-D input must be synchronized and depth registered.
# 9. SLAM and Localization Modes
You can change between the *SLAM* and *Localization mode* using the GUI of the map viewer.
### SLAM Mode
This is the default mode. The system runs in parallal three threads: Tracking, Local Mapping and Loop Closing. The system localizes the camera, builds new map and tries to close loops.
### Localization Mode
This mode can be used when you have a good map of your working area. In this mode the Local Mapping and Loop Closing are deactivated. The system localizes the camera in the map (which is no longer updated), using relocalization if needed.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
SLAM-用于单目+立体+RGBD相机的实时视觉SLAM-具有视觉环路检测+重定位功能.zip (224个子文件)
os_specific.c 2KB
ORBmatcher.cc 48KB
Tracking.cc 47KB
ORBextractor.cc 43KB
Optimizer.cc 40KB
PnPsolver.cc 28KB
Initializer.cc 26KB
LoopClosing.cc 25KB
LocalMapping.cc 23KB
Frame.cc 20KB
KeyFrame.cc 18KB
ViewerAR.cc 17KB
System.cc 15KB
Sim3Solver.cc 11KB
MapPoint.cc 11KB
KeyFrameDatabase.cc 10KB
MapDrawer.cc 7KB
stereo_euroc.cc 7KB
Viewer.cc 6KB
FrameDrawer.cc 6KB
ros_stereo.cc 5KB
rgbd_tum.cc 5KB
stereo_kitti.cc 5KB
ros_mono_ar.cc 5KB
mono_kitti.cc 4KB
mono_euroc.cc 4KB
mono_tum.cc 4KB
Converter.cc 4KB
ros_rgbd.cc 3KB
Map.cc 3KB
ros_mono.cc 2KB
FindBLAS.cmake 13KB
FindLAPACK.cmake 10KB
FindEigen3.cmake 3KB
FindEigen3.cmake 3KB
optimizable_graph.cpp 27KB
sparse_optimizer.cpp 20KB
types_six_dof_expmap.cpp 10KB
estimate_propagator.cpp 10KB
hyper_dijkstra.cpp 9KB
hyper_graph_action.cpp 9KB
optimization_algorithm_dogleg.cpp 8KB
ScoringObject.cpp 8KB
marginal_covariance_cholesky.cpp 7KB
optimization_algorithm_levenberg.cpp 7KB
factory.cpp 6KB
types_seven_dof_expmap.cpp 6KB
cache.cpp 5KB
Timestamp.cpp 5KB
string_tools.cpp 5KB
robust_kernel_impl.cpp 5KB
optimization_algorithm_factory.cpp 5KB
parameter_container.cpp 4KB
FORB.cpp 4KB
hyper_graph.cpp 4KB
timeutil.cpp 4KB
matrix_structure.cpp 3KB
optimization_algorithm_with_hessian.cpp 3KB
optimization_algorithm_gauss_newton.cpp 3KB
property.cpp 3KB
robust_kernel_factory.cpp 3KB
jacobian_workspace.cpp 3KB
batch_stats.cpp 3KB
sparse_block_matrix_test.cpp 3KB
Random.cpp 3KB
BowVector.cpp 3KB
solver.cpp 3KB
optimization_algorithm.cpp 2KB
types_sba.cpp 2KB
FeatureVector.cpp 2KB
robust_kernel.cpp 2KB
parameter.cpp 2KB
ORBvoc.txt.tar.gz 40.56MB
TemplatedVocabulary.h 41KB
optimizable_graph.h 25KB
sparse_optimizer.h 12KB
sparse_block_matrix_ccs.h 11KB
sparse_block_matrix.h 9KB
linear_solver_eigen.h 9KB
se3quat.h 8KB
hyper_graph.h 8KB
hyper_graph_action.h 8KB
block_solver.h 7KB
sim3.h 7KB
Frame.h 7KB
KeyFrame.h 7KB
PnPsolver.h 6KB
estimate_propagator.h 6KB
System.h 6KB
optimization_algorithm_factory.h 6KB
Tracking.h 6KB
types_six_dof_expmap.h 6KB
factory.h 6KB
types_seven_dof_expmap.h 6KB
solver.h 5KB
property.h 5KB
cache.h 5KB
string_tools.h 5KB
robust_kernel_factory.h 5KB
robust_kernel_impl.h 5KB
共 224 条
- 1
- 2
- 3
资源评论
极智视界
- 粉丝: 2w+
- 资源: 1459
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功