欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

用evo工具评估SLAM轨迹

程序员文章站 2022-04-16 20:37:24
...

 

用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

 
  1. sudo apt install python-pip

  2. pip install evo --upgrade --no-binary evo

出现问题: 

 
  1. Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/dateutil/relativedelta.pyc'

  2. Consider using the `--user` option or check the permissions.

解决:

pip install evo --upgrade --no-binary evo --user

2、测试

 
  1. cd ~/alan_dataset/EuRoC/mav0/state_groundtruth_estimate0

  2. evo_traj euroc data.csv --plot

出现问题:

 
  1. name: data

  2. infos: 19753 poses, 91.747m path length, 98.760s duration

  3. /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.

  4. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

  5. [ERROR] Unhandled error in evo.main_traj

  6. Traceback (most recent call last):

  7. File "/home/jinshan.lan/.local/lib/python2.7/site-packages/evo/entry_points.py", line 90, in launch

  8. main_module.run(args)

  9. File "/home/jinshan.lan/.local/lib/python2.7/site-packages/evo/main_traj.py", line 342, in run

  10. from evo.tools.plot import PlotMode

  11. File "/home/jinshan.lan/.local/lib/python2.7/site-packages/evo/tools/plot.py", line 36, in <module>

  12. import mpl_toolkits.mplot3d.art3d as art3d

  13. File "/usr/lib/python2.7/dist-packages/mpl_toolkits/__init__.py", line 2, in <module>

  14. __import__('pkg_resources').declare_namespace(__name__)

  15. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>

  16. @_call_aside

  17. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside

  18. f(*args, **kwargs)

  19. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set

  20. working_set = WorkingSet._build_master()

  21. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master

  22. return cls._build_from_requirements(__requires__)

  23. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements

  24. dists = ws.resolve(reqs, Environment())

  25. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 834, in resolve

  26. raise VersionConflict(dist, req).with_context(dependent_req)

  27. ContextualVersionConflict: (numpy 1.11.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('numpy>=1.12.0'), set(['pandas']))

  28.  
  29. [ERROR] evo module evo.main_traj crashed - no logfile written (disabled)

解决:

pip install numpy --upgrade --user

运行结果:

用evo工具评估SLAM轨迹

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) 中

 
  1. cd ~/Desktop/test_evo

  2. evo_traj tum FrameTrajectory_TUM_Format.txt --ref=data.tum -p

运行结果:

 用evo工具评估SLAM轨迹

5、计算绝对位姿误差(轨迹对齐)

evo_ape tum data.tum FrameTrajectory_TUM_Format.txt -va --plot

运行结果:

用evo工具评估SLAM轨迹

用evo工具评估SLAM轨迹    用evo工具评估SLAM轨迹

绝对轨迹误差:APE(Absolute Trajectory Error)

用evo工具评估SLAM轨迹

gt(groundtruth)为真实轨迹;est(estimate):估计轨迹

绝对轨迹的误差为每个位姿李代数的均方根误差(Root-Mean-Squared Error,RMSE)

绝对平移误差(Average Translational Error)

用evo工具评估SLAM轨迹

trans括号表示内部变量的平移部分。

用evo工具评估SLAM轨迹

参考:

知乎:一种评估SLAM系统参数的实用工具

使用 evo 工具评测 VI ORB SLAM2 在 EuRoC 上的结果

视觉SLAM十四讲第二版