- 安装pangolin
pangolin的github地址https://github.com/stevenlovegrove/Pangolin
在安装Pangolin时出现问题
-- Found WAYLAND: /usr/lib/x86_64-linux-gnu/libwayland-client.so;/usr/lib/x86_64-linux-gnu/libwayland-server.so;/usr/lib/x86_64-linux-gnu/libwayland-egl.so;/usr/lib/x86_64-linux-gnu/libwayland-cursor.so
-- Checking for module 'xkbcommon'
-- No package 'xkbcommon' found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
src/CMakeLists.txt:219 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
See also "/home/fcl/Pangolin/build/CMakeFiles/CMakeOutput.log".
参考https://blog.csdn.net/weixin_38504276/article/details/100673890
解决办法:
sudo apt-get install libxkbcommon-x11-dev
然后再cmake ..
参考
使用ros的参考https://blog.csdn.net/RadiantJeral/article/details/82193370
- 安装orb-slam2
orb-slam2的github地址https://github.com/raulmur/ORB_SLAM2
安装和跑通参考https://blog.csdn.net/u014709760/article/details/85253525
问题:usleep
参考https://www.cnblogs.com/bigzhao/p/6537562.html
参考github上的回答https://github.com/raulmur/ORB_SLAM2/pull/834/commits/d5be22c12aedde9265d766baa036021883b97cc0
在以下的文件中加入头文件#include <unistd.h>
/home/***/ORB_SLAM2/src/LoopClosing.cc
/home/f**/ORB_SLAM2/src/LocalMapping.cc
/home/***/ORB_SLAM2/src/System.cc
/home/***/ORB_SLAM2/src/Tracking.cc
/home/***/ORB_SLAM2/src/Viewer.cc
/home/***/ORB_SLAM2/Examples/Monocular/mono_euroc.cc
/home/*c*/ORB_SLAM2/Examples/Monocular/mono_kitti.cc
/home/***/ORB_SLAM2/Examples/Monocular/mono_tum.cc
/home/***/ORB_SLAM2/Examples/RGB-D/rgbd_tum.cc
/home/***/ORB_SLAM2/Examples/Stereo/stereo_euroc.cc
/home/**l/ORB_SLAM2/Examples/Stereo/stereo_kitti.cc
正确的src和Example的文件夹在文档里
- 跑EuRoC的V1_01_easy数据集
参考github地址
输入./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE_FOLDER/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
以medium为例,在ORB-SLAM2文件夹下
./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml /home/***/dataset/V1_02_medium/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/V102.txt
注意在该路径下不用在路径下加/,但是如果跳出了该路径要加上/,如/home
出现问题Failed to load module "canberra-gtk-module"
由链接下载https://blog.csdn.net/u014337397/article/details/81068991
sudo apt-get install libcanberra-gtk-module
- 位姿图
之后,在ORB-SLAM2的文件夹下出现KeyFrameTrajectory.txt文件。
把它移植到另一个文件夹,我的是
/home/***/reconstruction/ORB-SLAM2-V1_01_easy/路径下面
并改名字
然后在
/home/***/dataset/V1_01_easy/mav0/state_groundtruth_estimate0/
路径下运行代码
evo_traj tum /home/***/reconstruction/ORB-SLAM2-V1_01_easy/KeyFrameTrajectory.txt --ref=ground_truth.tum -p --plot_mode=xyz --align --correct_scale
成功!
另外大家常见的不对齐问题参考http://www.mamicode.com/info-detail-2916431.html
今天用orbslam2跑euroc数据集,将结果和真实轨迹用evo测评,发现差别特别大:
evo_traj tum data.tum CameraTrajectory.txt --plot --plot_mode=xy
最后发现两组数据没有对齐,evo提供了自动对齐与尺度校正功能,正确的用法如下:(需要指定参考数据--ref=data.tum)
evo_traj tum CameraTrajectory.txt --ref=data.tum -p --plot_mode=xy --align --correct_scale
其他的研究比如:ORB-SLAM2地图保存加载以及重定位参考https://blog.csdn.net/learning_tortosie/article/details/81384717