用evo工具评估SLAM轨迹
用evo工具评估SLAM轨迹
转载:https://blog.csdn.net/A_L_A_N/article/details/88708979
evo github 地址:https://github.com/MichaelGrupp/evo
不同格式的轨迹文件及相互转换:https://github.com/MichaelGrupp/evo/wiki/Formats
问题汇总:https://github.com/MichaelGrupp/evo/issues?q=is%3Aissue+is%3Aclosed
1、安装 evo
-
sudo apt install python-pip
-
pip install evo --upgrade --no-binary evo
出现问题:
-
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/dateutil/relativedelta.pyc'
-
Consider using the `--user` option or check the permissions.
解决:
pip install evo --upgrade --no-binary evo --user
2、测试
-
cd ~/alan_dataset/EuRoC/mav0/state_groundtruth_estimate0
-
evo_traj euroc data.csv --plot
出现问题:
-
name: data
-
infos: 19753 poses, 91.747m path length, 98.760s duration
-
/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
-
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
-
[ERROR] Unhandled error in evo.main_traj
-
Traceback (most recent call last):
-
File "/home/jinshan.lan/.local/lib/python2.7/site-packages/evo/entry_points.py", line 90, in launch
-
main_module.run(args)
-
File "/home/jinshan.lan/.local/lib/python2.7/site-packages/evo/main_traj.py", line 342, in run
-
from evo.tools.plot import PlotMode
-
File "/home/jinshan.lan/.local/lib/python2.7/site-packages/evo/tools/plot.py", line 36, in <module>
-
import mpl_toolkits.mplot3d.art3d as art3d
-
File "/usr/lib/python2.7/dist-packages/mpl_toolkits/__init__.py", line 2, in <module>
-
__import__('pkg_resources').declare_namespace(__name__)
-
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
-
@_call_aside
-
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
-
f(*args, **kwargs)
-
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
-
working_set = WorkingSet._build_master()
-
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
-
return cls._build_from_requirements(__requires__)
-
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
-
dists = ws.resolve(reqs, Environment())
-
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 834, in resolve
-
raise VersionConflict(dist, req).with_context(dependent_req)
-
ContextualVersionConflict: (numpy 1.11.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('numpy>=1.12.0'), set(['pandas']))
-
[ERROR] evo module evo.main_traj crashed - no logfile written (disabled)
解决:
pip install numpy --upgrade --user
运行结果:
3、将 EuRoC 数据集中 .csv 文件形式的 groundtruth 转换为 TUM 形式的轨迹文件
evo_traj euroc data.csv --save_as_tum
TUM 形式的轨迹文件格式:
每行8个数,用空格分隔,包含时间戳(单位:秒)、位置和旋转(四元素表示)
timestamp x y z q_x q_y q_z q_w
4、多轨迹显示(轨迹未对齐)
(a)上面将 EuRoC 数据集中 MH_04_difficult 序列的 groundtruth(.csv文件) 转换为 TUM 形式的轨迹文件,文件名为 data.tum
(b)通过双目 ORBSLAM 跑 MH_04_difficult 数据集得到 TUM 形式的轨迹文件,文件名为 FrameTrajectory_TUM_Format.txt
见:ORB_SLAM2 & VI-ORBSLAM 相关(#alan#)
将两个 TUM 形式的轨迹文件放入同一个文件夹 (test_evo) 中
-
cd ~/Desktop/test_evo
-
evo_traj tum FrameTrajectory_TUM_Format.txt --ref=data.tum -p
运行结果:
5、计算绝对位姿误差(轨迹对齐)
evo_ape tum data.tum FrameTrajectory_TUM_Format.txt -va --plot
运行结果:
绝对轨迹误差:APE(Absolute Trajectory Error)
gt(groundtruth)为真实轨迹;est(estimate):估计轨迹
绝对轨迹的误差为每个位姿李代数的均方根误差(Root-Mean-Squared Error,RMSE)
绝对平移误差(Average Translational Error)
trans括号表示内部变量的平移部分。
参考:
使用 evo 工具评测 VI ORB SLAM2 在 EuRoC 上的结果
视觉SLAM十四讲第二版
推荐阅读
-
ORB-SLAM、ORB-SLAM2跑通,运行EuRoC数据集,用EVO评估
-
python中 使用EVO工具 批量评估里程计 脚本
-
如何显示ORB_SLAM2生成的关键帧轨迹以及如何使用evo工具评估EuRoCDataset真实际位姿轨迹和ORB_SLAM2算法的估计位姿轨迹?
-
用evo工具评估SLAM轨迹
-
SLAM轨迹精度评估工具evo使用方法
-
视觉SLAM笔记--第3篇: SLAM轨迹评估工具(evo安装与使用)
-
SLAM轨迹精度评估工具evo安装以及使用方法详细介绍,以及如何用来评估ORB-SLAM2生成的轨迹精度
-
SLAM数据集(tum/kitti)轨迹对齐与结果评估
-
SLAM和里程计评估工具——evo
-
rpg_trajectory_evaluation工具评估SLAM/VIO系统