MichaelGrupp / evo

Python package for the evaluation of odometry and SLAM
https://michaelgrupp.github.io/evo/
GNU General Public License v3.0
3.43k stars 746 forks source link

Question about the difference between RPE/APE w.r.t. translation and full transformation #596

Closed TakShimoda closed 10 months ago

TakShimoda commented 12 months ago

Hello, thank you for this library.

I have a question about the differences between getting the RPE/APE w.r.t. translation and full transformation. I understand from the metrics tutorial from the jupyter notebook files, for RPE we get the error matrix with:

$E{i,j} = \delta{est{i,j}} \ominus \delta{ref{i,j}} = (P{ref,i}^{-1}P{ref,j})^{-1} (P{est,i}^{-1}P_{est,j}) \in \mathrm{SE}(3)$ and then w.r.t. translation and full transformation, the RPE's are:

$RPE{i,j} = | \mathrm{trans}(E{i,j}) |$ $RPE{i,j} = | E{i,j} - I_{4 \times 4} |_F$

I tried comparing differences with ORB-SLAM3 used in a multi-robot back-end as an example and I can hardly see the differences. e.g. outputs for the same trajectory estimates (RPE for example):

evo_rpe tum KF_3_ftum.csv ~/Documents/Trial_Data/euroc/MH04/mav0/state_groundtruth_estimate0/data_tum.tum --delta_unit m

RPE w.r.t. translation part (m)

for delta = 1 (m) using consecutive pairs
(not aligned)

       max  0.083732
      mean  0.037874
    median  0.035181
       min  0.009489
      rmse  0.041627
       sse  0.119566
       std  0.017273

evo_rpe tum KF_3_ftum.csv ~/Documents/Trial_Data/euroc/MH04/mav0/state_groundtruth_estimate0/data_tum.tum --delta_unit m -r full

RPE w.r.t. full transformation (unit-less)
for delta = 1 (m) using consecutive pairs
(not aligned)

       max  0.083733
      mean  0.037899
    median  0.035187
       min  0.009503
      rmse  0.041646
       sse  0.119674
       std  0.017265

I noticed using APE/RPE w.r.t. translation part was the default, but I'm wondering why it's used instead of the full transformation? I understand sometimes the ground-truth or trajectory may not have rotations, but wouldn't setting the rotation part of the transformation matrix to the identity matrix for all timestamps take care of that issue?

Thank you.

MichaelGrupp commented 10 months ago

The full transformation metric is a mathematically valid metric, but not so intuitive to interpret. If you get 0 with it your trajectories are equal. But since the determinant of a rotation matrix is always 1 and the translation vector can have infinitely high values, it is hard to understand from the numeric result how the distribution between the two error types (rotation, translation) is. Therefore, it's usually more practical to check rotation and translation in separate steps and translation is set as default in this tool.

TakShimoda commented 10 months ago

Thank you, that answered my question.