目录
一、安装
(1)下载源码
(2)编译
(3)遇到问题
二、运行
(1)非ROS下用的EUROC数据集MH05
(2)ROS下用的EUROC数据集MH04
三、 EVO安装&使用
(1)安装
(2)使用
四、与ORB_SLAM2性能对比
(1)单目-非ROS下
(2)双目-ROS下
五、总结
环境:ubtuntu16
第三方库:Pangolin opencv3.2 Eigen3
https://github.com/UZ-SLAMLab/ORB_SLAM3
ORB-SLAM3论文地址:https://arxiv.org/abs/2007.11898
cd ORB-SLAM3/
chmod +x build.sh
sudo ./build.sh
/home/one/catkin_ws/src/ORB_SLAM3/src/LocalMapping.cc:628:49: error: no match for ‘operator/’ (operand types are ‘cv::Matx
解决方法:找到对应文件所在行,把x3D = x3D_h.get_minor<3,1>(0,0) / x3D_h(3)
换成
x3D = cv::Matx31f(x3D_h.get_minor<3,1>(0,0)(0) / x3D_h(3), x3D_h.get_minor<3,1>(0,0)(1) / x3D_h(3), x3D_h.get_minor<3,1>(0,0)(2) / x3D_h(3));
下载数据集&测试
kmavvisualinertialdatasets – ASL Datasets
单目:
./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml /home/one/dataset/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/MH04.txt
单目+IMU:
./Examples/Monocular-Inertial/mono_inertial_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular-Inertial/EuRoC.yaml ./dataset ./Examples/Monocular-Inertial/EuRoC_TimeStamps/MH05.txt
双目:
./Examples/Stereo/stereo_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo/EuRoC.yaml ./dataset ./Examples/Stereo/EuRoC_TimeStamps/MH05.txt
双目+IMU:
./Examples/Stereo-Inertial/stereo_inertial_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo-Inertial/EuRoC.yaml ./dataset ./Examples/Stereo-Inertial/EuRoC_TimeStamps/MH05.txt
双目:
rosrun ORB_SLAM3 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml true
rosbag play MH_04_difficult.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw
双目+imu:
rosrun ORB_SLAM3 Stereo_Inertial Vocabulary/ORBvoc.txt Examples/Stereo-Inertial/EuRoC.yaml true
rosbag play MH_04_difficult.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw /imu0:=/imu
注意:这里EUROC数据集是没有深度图的,暂时不跑RGB-D
sudo apt install python-pip
pip install evo --upgrade --no-binary evo
单轨迹:
evo_traj euroc data.csv --plot
因为这里.csv文件有17列数据,与.txt对不齐,所以把data.csv转换成.tum格式
evo_traj euroc data.csv --save_as_tum
真实轨迹与运行轨迹-对齐:
evo_traj tum KeyFrameTrajectory.txt --ref=data.tum -p --plot_mode xyz -a --correct_scale
计算ape-绝对位姿误差
evo_ape tum KeyFrameTrajectory.txt data.tum -p --plot -s --correct_scale -a --align -v --save_results ape.zip
关于evo的更多用法可自行搜索
ORB_SLAM3
单目:
单目+IMU:
ORB_SLAM2
单目:
为了生成轨迹文件,这里在ROS/ORB_SLAM3/src下的.cc文件对应位置加上生成轨迹的代码
ros::spin();
// Stop all threads
SLAM.Shutdown();
// Save camera trajectory
SLAM.SaveKeyFrameTrajectoryTUM("KeyFrameTrajectory_TUM_Format.txt");
SLAM.SaveTrajectoryTUM("FrameTrajectory_TUM_Format.txt");
SLAM.SaveTrajectoryKITTI("FrameTrajectory_KITTI_Format.txt");
ros::shutdown();
ORB_SLAM3
双目:
双目+imu:
ORB_SLAM2
通过对比结果可以得到以下结论:
1-跑单目MH05,ORB_SLAM3与ORB_SLAM2表现差不多,ORB_SLAM3加了IMU之后,跑的时候更稳定,精度有所下降。
2-跑双目MH04,ORB-SLAM2会有一部分轨迹丢失,而ORB_SLAM3比ORB_SLAM2稳定,加了IMU之后,精度提升。