文章目录
- evo参数设置
- evo_traj
- 指标度量
- evo_ape
- evo_rpe
- 结果比较
evo工具主要有如下六个常用命令:
- evo_ape - 用于评估绝对位姿误差;
- evo_rpe- 用于评估相对位姿误差;
- evo_traj - 这个主要是用来画轨迹、输出轨迹文件、转换数据格式等功能;
- evo_res- 比较来自evo_ape或evo_rpe生成的一个或多个结果文件的工具;
- evo_fig - (实验)工具,用于重新打开序列化图(使用
–serialize_plot
保存); - evo_config - 这个主要用于evo工具全局设置和配置文件操作。
evo参数设置
#改变背景为白色背景的网格
evo_config set plot_seaborn_style whitegrid
#设置字体类型和比例
evo_config set plot_fontfamily serif plot_fontscale 1.3
#设置轨迹线宽
evo_config set plot_linewidth 1.2
#改变参考轨迹的线条样式:
evo_config set plot_reference_linestyle -
#设置参考线颜色为红色
evo_config set plot_reference_color red
#使用 LaTeX 渲染器,因为我们使用 LaTeX 来写论文,所以我们也想使用 LaTeX 来渲染图中的字体:
evo_config set plot_usetex
#您可能需要将 plot texsystem 参数更改为机器上安装的 LaTeX 系统,如果这在第一次尝试时不起作用。
evo_config set plot_texsystem pdflatex
#设置画图的图像大小为宽10 高9
evo_config set plot_figsize 10 9
evo_traj
evo_traj命令十分有用,它主要用于画轨迹图、表格,转换数据格式等等操作。
读取bag轨迹
evo_traj bag data.bag /odom /tf:map.base_link --ref /groundtruth
将bag格式的数据导出为tum格式
evo_traj bag .bag --all_topics --save_as_tum
将所有轨迹画到一个图里并保存
evo_traj tum --sync -p --plot_mode xy --save_plot SAVE_PLOT --ref REF traj_file ...
--sync
associate trajectories via matching timestamps , requires --ref--ref REF
trajectory that will be marked/used as the reference-p, --plot
show plot window--plot_mode {xy,xz,yx,yz,zx,zy,xyz}
the axes for plot projection--save_plot SAVE_PLOT
path to save plo
指标度量
这些内置的命令行应用程序可以让你根据参考(groundtruth)评估估计的轨迹
evo_ape
evo_rpe
command format reference-trajectory estimated-trajectory [options]
command:
evo_ape
evo_rpe
format:
- kitti
- tum
- euroc
- bag
- bag2
evo_ape
用于评估两条轨迹的绝对位姿误差
对于SLAM系统, 估计轨迹的全局一致性是重要度量,如何评估全局一致性? 就是通过比较被估计值和真值轨迹之间的绝对距离来得到。
首先将两条轨迹对齐。记P1:nP_{1:n}P1:n代表轨迹的估计,Q1:nQ_{1:n}Q1:n代表真值轨迹,则时间戳iii处的绝对估计误差为:
Fi=Qi−1SPiF_i=Q_i^{-1}SP_iFi=Qi−1SPi
则针对所有时刻定义平移分量的 均方根误差(RMSE)、和方差(SSE):
RMSE(F1:n):=(∑i=1n∥Trans(Fi)∥2)1/2SSE:=∑i=1n∥Trans(Fi)∥2\begin{gathered} RMSE(F_{1:n}) :=\left(\sum\limits_{i=1}^n\|{\rm Trans}(F_i)\|^2\right)^{1/2} \\ SSE :=\sum\limits_{i=1}^n\|{\rm Trans}(F_i)\|^2 \end{gathered} RMSE(F1:n):=(i=1∑n∥Trans(Fi)∥2)1/2SSE:=i=1∑n∥Trans(Fi)∥2
evo_ape tum -a -p --save_plot SAVE_PLOT --plot_mode xy --save_results SAVE_RESULTS ref_file est_file
-a, --align
alignment with Umeyama’s method (no scale)-p, --plot
show plot window--plot_mode {xy,xz,yx,yz,zx,zy,xyz}
the axes for plot projection--save_plot SAVE_PLOT
path to save plot--save_results SAVE_RESULTS
.zip file path to store results
evo_rpe
相对位姿误差测量了轨迹在一个固定的时间区间 Δ\DeltaΔ内的局部准确度。 因此,相对位姿误差对应轨迹的漂移。
Ei:=(Qi−1Qi+Δ)−1(Pi−1Pi+Δ)E_i:=(Q_i^{-1}Q_{i+\Delta})^{-1}(P_i^{-1}P_{i+\Delta})Ei:=(Qi−1Qi+Δ)−1(Pi−1Pi+Δ)
根据上式,对于一个有n个相机位姿的序列中,我们获得m=n−Δm=n−\Deltam=n−Δ 个独立的沿着序列的相对位姿误差。则可以定义平移分量的的所有时刻的均方根误差RMSE:
RMSE(E1:n,Δ):=(1m∑i=1m∥Trans(Ei)∥2)1/2RMSE(E_{1:n},\Delta):=\bigg(\frac{1}{m}\sum\limits_{i=1}^{m}\|\rm Trans(E_i)\|^2\bigg)^{1/2} RMSE(E1:n,Δ):=(m1i=1∑m∥Trans(Ei)∥2)1/2
上式中的 (Pi−1Pi+Δ)(P_i^{-1}P_{i+\Delta})(Pi−1Pi+Δ) 是估计的(Qi−1Qi+Δ)(Q_i^{-1}Q_{i+\Delta})(Qi−1Qi+Δ),计算 (Qi−1Qi+Δ)−1(Pi−1Pi+Δ)(Q_i^{-1}Q_{i+\Delta})^{-1} (P_i^{-1}P_{i+\Delta})(Qi−1Qi+Δ)−1(Pi−1Pi+Δ) 可以直观的得到两条轨迹的差值;
此处计算的是EiE_iEi的平移分量,旋转误差也可以被估计,但一般平移误差就足够了(因为旋转误差会随着平移误差的上升而增加)。时间参数 Δ\DeltaΔ对于帧速较快的相同,如30Hz的传感器,可选择Δ=30\Delta=30Δ=30以得到每秒的漂移。
结果比较
evo_res --use_rel_time --use_filenames -p --save_plot SAVE_PLOT --save_table SAVE_TABLE result_files [result_files ...]
--use_rel_time
use relative timestamps if available--use_filenames
use the filenames to label the data-p, --plot
show plot window--save_plot SAVE_PLOT
path to save plot--save_table SAVE_TABLE
path to a file to save the results in a table
参考链接
github wiki