目錄
一、安裝
(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
(1)下載原始碼
https://github.com/UZ-SLAMLab/ORB_SLAM3
ORB-SLAM3論文地址:https://arxiv.org/abs/2007.11898
(2)編譯
cd ORB-SLAM3/
chmod +x build.sh
sudo ./build.sh
(3)遇到問題
/home/one/catkin_ws/src/ORB_SLAM3/src/LocalMapping.cc:628:49: error: no match for ‘operator/’ (operand types are ‘cv::Matx<float, 3, 1>’ and ‘float’) x3D = x3D_h.get_minor<3,1>(0,0) / x3D_h(3);
解決方法:找到對應檔案所在行,把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
(1)非ROS下用的EUROC資料集MH05
單目:
./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
(2)ROS下用的EUROC資料集MH04
雙目:
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
三、 EVO安裝&使用
(1)安裝
sudo apt install python-pip
pip install evo --upgrade --no-binary evo
(2)使用
單軌跡:
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_SLAM2性能對比
(1)單目-非ROS下
ORB_SLAM3
單目:
?
單目+IMU:
?
ORB_SLAM2
單目:
?
(2)雙目-ROS下
為了生成軌跡檔案,這里在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之后,精度提升,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/319616.html
標籤:AI
