虚拟机使用ubuntu20.04
2022年2月初下载并安装最新ORBSLAM3(与网上教程对照,我的版本特点是无euroc_examples,且有Examples与Examples_old两个文件夹)
数据集放在文件夹Datasets中,结构为/home/sbr/ORB_SLAM3/Datasets/MH01/mav0
问题一
在尝试运行MH01时,发现用双目(Stereo)可顺利运行,代码为
./Examples/Stereo/stereo_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo/EuRoC.yaml ./Datasets/MH01 ./Examples/Stereo/EuRoC_TimeStamps/MH01.txt
可顺利出现如图两个界面
但是当我尝试单目(Monocular),即用如下代码运行时总是出错
./Examples/Monocular/mono_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular/EuRoC.yaml ./Datasets/MH01 ./Examples/Monocular/EuRoC_TimeStamps/MH01.txt
运行结果主要为
Loading ORB Vocabulary. This could take a while...
Vocabulary loaded!
Initialization of Atlas from scratch
Creation of new map with id: 0
Creation of new map with last KF id: 0
Seq. Name:
There are 1 cameras in the atlas
Camera 0 is pinhole
First KF:0; Map init KF:0
New Map created with 271 points
virtual int g2o::SparseOptimizer::optimize(int, bool): 0 vertices to optimize, maybe forgot to call initializeOptimization()
virtual int g2o::SparseOptimizer::optimize(int, bool): 0 vertices to optimize, maybe forgot to call initializeOptimization()
virtual int g2o::SparseOptimizer::optimize(int, bool): 0 vertices to optimize, maybe forgot to call initializeOptimization()
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Relocalized!!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Fail to track local map!
Shutdown
Saving trajectory to f_dataset-MH01_mono.txt ...
There are 1 maps in the atlas
Map 0 has 288 KFs
End of saving trajectory to f_dataset-MH01_mono.txt ...
当运行到New Map created with 271 points 处时 我的笔记本开始轰鸣并长时间卡死 但不会有任何新界面弹出 等待很久便会出现之后的Fail to track local map!之类的报错
我尝试了各种办法 比如用数据集MH02来替代 将Examples换成Examples_old 重新运行build.sh 但没用 单目总是卡死 按网上说 顺利的话应该会出现类似上图所示的两个窗口 但我实在不知道怎么办了
问题二
我还遇到了个可能有关的错误 我安装ros并成功编译orbslam3中的build_ros.sh 按教程更改路径 启动roscore 打开usb_cam并运行如下代码
rosrun ORB_SLAM3 Mono /home/sbr/ORB_SLAM3/Vocabulary/ORBvoc.txt /home/sbr/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/Asus.yaml
报错结果如下
Loading ORB Vocabulary. This could take a while...
Vocabulary loaded!
Initialization of Atlas from scratch
Creation of new map with id: 0
Creation of new map with last KF id: 0
Seq. Name:
Camera Parameters:
- Camera: Pinhole
- Image scale: 1
- fx: 535.4
- fy: 539.2
- cx: 320.1
- cy: 247.6
- k1: 0
- k2: 0
- p1: 0
- p2: 0
- fps: 30
- color order: RGB (ignored if grayscale)
ORB Extractor Parameters:
- Number of Features: 1000
- Scale Levels: 8
- Scale Factor: 1.2
- Initial Fast Threshold: 20
- Minimum Fast Threshold: 7
There are 1 cameras in the atlas
Camera 0 is pinhole
Starting the Viewer
段错误 (核心已转储)
会在Loading ORB Vocabulary. This could take a while短暂停顿 后闪烁一次弹窗 并出现段错误 (核心已转储)等报错 我按教程删去一些cmakelist中的-march=native 但是没用 依教程 顺利的话应该出现类似下图结果
求帮忙!万谢