12.28:
一、orb-slam3安装及编译
1.1 参考ORB-SLAM3配置安装及运行---Ubuntu20.04(2021年)_foxy下运行orb_slam3跑包-CSDN博客
将该安装的库依次安装。感谢这位大佬,流程很细。
下面是我安装时遇到的问题及解决办法,希望能对你有帮助
1.2 ippicv_2020_lnx_intel64_general_20191018_general.tgz下载问题
(1)感谢这位大佬。请自行下载ippicv_2020_lnx_intel64_general_20191018_general.tgz_ippicv_2020_lnx_intel64_20191018_general.tgz-CSDN博客
(2)下载后在cmakelist里指定,替代URL下载。
找到/home/guangpu/Desktop/orb-slam/opencv/opencv-3.4.15/3rdparty/ippicv/ippicv.cmake文件37行,如下:
ocv_download(FILENAME ${OPENCV_ICV_NAME}
HASH ${OPENCV_ICV_HASH}
URL
"${OPENCV_IPPICV_URL}"
"$ENV{OPENCV_IPPICV_URL}"
"https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/"
DESTINATION_DIR "${THE_ROOT}"
ID IPPICV
STATUS res
UNPACK RELATIVE_URL)
修改为:set(OPENCV_ICV_NAME "file://***/opencv-3.4.15/ippicv_2020_lnx_intel64_general_20191018_general.tgz")
1.3 编译过程中报错:error: ‘decay_t’ is not a member of ‘std’; did you mean ‘decay’?
原因是c++11编译问题,找到ORB-SLAM3的cmakelist.txt的17-21行:
17行:CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)修改为:CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX11)
21行:set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")修改为set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
1.4 离线数据运行时无图像窗口
找到对应的ORB_SLAM3-master/Examples/Monocular/mono_euroc.cc中的83行左右的,如下代码中的false改成true。然后重新编译ORB-SLAM, ./build.sh
ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::MONOCULAR, **false**);
2,EVO
2.1 安装
参考Ubuntu20.04安装evo(详细教程)【亲测有效】-CSDN博客
如遇报错,更新一下pip。然后多试几次,报错都由于网络的问题
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
2.2 对比轨迹
(1)找到GT数据,先转换为tum格式
evo_traj euroc /mnt/orb_slam_data/mav0/state_groundtruth_estimate0/data.csv --save_as_tum
(2)轨迹对比
evo_traj tum data.tum KeyFrameTrajectory.txt --ref=data.tum -p --plot_mode=xyz -a --correct_scale
(3)报错,时间戳对不齐
[ERROR] found no matching timestamps between reference and CameraTrajectory.txt with max. time diff 0.01 (s) and time offset 0.0 (s)
参考如下文章:
ubuntu18.04运行orbslam3并测试_[error] found no matching timestamps between refer-CSDN博客
(4)ModuleNotFoundError: No module named 'tkinter',
参考" ModuleNotFoundError: No module named 'tkinter' "的解决方法 - 菜鸟学院
(5)ImportError: cannot import name 'ImageTk' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
sudo apt-get install python3-pil python3-pil.imagetk
(6)Failed to load module "canberra-gtk-module"
sudo apt install libcanberra-gtk-module
2.3 评估精度
evo_ape tum data.tum CameraTrajectory.txt -p --plot_mode=xz -a -s
2.4 数据集格式转换
EuRoc-> TUM:evo_traj euroc data.csv --save_as_tum
3,查看依赖库版本
Opencv:pkg-config --modversion opencv
Eigen:dpkg -l | grep eigen