evo_wiki翻译(evo_traj和Formats)

目录

evo_traj

Basics

Check trajectory data

Plotting

Exporting

Alignment and transformation

Geometric alignment

Temporal alignment

Transformations

Formats

Trajectories

bag & bag2 - ROS1/ROS2 bagfile

euroc - EuRoC MAV dataset format (also used in TUM VI dataset)

kitti - KITTI dataset pose format

tum - TUM RGB-D dataset trajectory format

Saving / Exporting to other formats

Result zip files for evo_res


https://github.com/MichaelGrupp/evo/wiki/evo_traj

evo_traj

Michael Grupp edited this page on Jan 4, 2022 · 22 revisions

evo_traj is the main tool to do house-keeping stuff with multiple trajectories, such as:

displaying some infos

plotting

verifying that the data is valid

exporting to other formats

applying transformations

etc.

evo_traj是用多个轨迹来做家务的主要工具,例如:
显示一些信息
绘图
验证数据是否有效
导出为其他格式
应用变换

Basics

evo_traj can open as many trajectories as you want. In case of a text based trajectory format (tum, euroc, kitti - see also the formats chapter) you give the trajectory files as arguments, for example:

evo_traj可以打开任意多个轨迹。在基于文本的轨迹格式(tum、euroc、kitti-另请参阅格式一章)的情况下,您将轨迹文件作为参数,例如:

evo_traj tum traj_1.txt traj_2.txt traj_3.txt

(here, you could also use glob notation on a UNIX-like system: evo_traj tum traj_*)

(在这里,您也可以在类似UNIX的系统上使用glob表示法:evo_traj-tum-traj_*)

In case of a ROS bagfile, you give the file path followed by the names of the topics you want to use:

在ROS bagfile的情况下,您提供文件路径,后跟要使用的主题的名称:

evo_traj bag data.bag /groundtruth /odom /tf:map.base_link

or, with a ROS2 bags:

evo_traj bag2 data /groundtruth /odom /tf:map.base_link

You can also use the --all_topics option to load all trajectories inside the bagfile. TF topics can be used with a special syntax described here

A reference trajectory can be marked with --ref:

您还可以使用--all_topics选项加载bagfile内的所有轨迹。TF主题可以与此处描述的特殊语法一起使用
参考轨迹可以用--ref标记:

evo_traj bag data.bag /odom /tf:map.base_link --ref /groundtruth

You have to give the --ref argument if you want to use the alignment features with evo_traj (-a / --align, -s / --correct_scale or --n_to_align).

如果要将对齐功能与evo_traj(-a/--align、-s/-correct_scale或-n_to_align)一起使用,则必须给出--ref参数。

Check trajectory data

By default, evo_traj prints out only a few important infos about the trajectories that you feed into it in this format:

默认情况下,evo_traj只打印出一些关于您以这种格式输入的轨迹的重要信息:

name:    groundtruth

infos:     12765 poses, 304.207m path length, 889.019s duration

In verbose mode (-v/--verbose) the output changes to this format:

在详细模式(-v/-verbose)中,输出更改为以下格式:

name:   groundtruth

infos

        duration (s)    889.01894474

        nr. of poses    12765

        path length (m) 304.206897009

        pos_end (m)     [ -3.32159757  -4.64051651  32.7839329 ]

        pos_start (m)   [-0.00489994 -0.01775981 -0.01375532]

        t_end (s)       1502793459.3

        t_start (s)     1502792570.28

You can get the most detailed output with the --full_check flag. This performs some math and logic checks - e.g. if the quaternions have unit norm or if the timestamps are ascending. Some speed values are shown as well (except for kitti where we don't have timestamps).

使用--fullcheck标志可以获得最详细的输出。这会执行一些数学和逻辑检查,例如四元数是否具有单位范数或时间戳是否为升序。还显示了一些速度值(除了我们没有时间戳的kitti)。

name:   groundtruth

infos

        duration (s)    889.01894474

        nr. of poses    12765

        path length (m) 304.206897009

        pos_end (m)     [ -3.32159757  -4.64051651  32.7839329 ]

        pos_start (m)   [-0.00489994 -0.01775981 -0.01375532]

        t_end (s)       1502793459.3

        t_start (s)     1502792570.28

checks

        SE(3) conform   yes

        array shapes    ok

        nr. of stamps   ok

        quaternions     ok

        timestamps      ok

stats

        v_avg (km/h)    1.411572

        v_avg (m/s)     0.392103

        v_max (km/h)    3.038775

        v_max (m/s)     0.844104

        v_min (km/h)    0.001567

        v_min (m/s)     0.000435

Tip: On UNIX-like systems, pipe the output to less to get a more comfortable view when loading multiple trajectories. If you don't want any output except warnings and errors, use --silent.

提示:在类似UNIX的系统上,当加载多个轨迹时,将输出管道传输到less,以获得更舒适的视图。如果除了警告和错误之外不需要任何输出,请使用--silent。

Plotting

Append -p or --plot to your command to plot the trajectories. You can specify the view with --plot_mode - e.g. --plot_mode xz for a 2D view at the x and z axes or --plot_mode xyz for a 3D view. In any case, there's also a second tab in the plot window with the x, y and z values plotted individually and a third one with roll, pitch and yaw angles (xyz-convention).

See also here for further information: Plottinghttps://github.com/MichaelGrupp/evo/wiki/Plotting

将-p或--plot附加到命令中以绘制轨迹。您可以使用--plot_mode指定视图,例如,--plot_mode-xz用于x和z轴上的二维视图,--plot_modexyz用于三维视图。在任何情况下,绘图窗口中还有第二个选项卡,分别绘制x、y和z值,第三个选项卡显示滚转、俯仰和偏航角(xyz约定)。
有关更多信息,请参见此处:绘图

Exporting

See here.https://github.com/MichaelGrupp/evo/wiki/Formats#saving--exporting-to-other-formats

Alignment and transformation

Geometric alignment

If you give a reference trajectory with --ref, you can align the other trajectories to the reference with Umeyama's method:

--align or -a = SE(3) Umeyama alignment (rotation, translation)

--align --correct_scale or -as = Sim(3) Umeyama alignment (rotation, translation, scale)

--correct_scale or -s = scale correction only

The alignment_demo.py script shows the different types of alignment with an example trajectory. It's also possible to align only the first n poses of the trajectories with --n_to_align, for example --n_to_align 100.

几何线形
如果使用--ref给出参考轨迹,则可以使用Umeyama的方法将其他轨迹与参考对齐:
--align或-a=SE(3)Umeyama 对齐(旋转、平移)
--align—correct_scale或-as=Sim(3)Umeyama对齐(旋转、平移、缩放)
--correct_scale或-s=仅刻度校正
alignment_demo.py脚本显示了具有示例轨迹的不同类型的对齐。也可以仅将轨迹的前n个姿态与-n_to_align对齐,例如-n_to_align 100。

 

New since v1.5.0: A simple origin alignment that can be useful for drift/loop closure evaluation is available with --align_origin. This is not based on the Umeyama algorithm.

v1.5.0以来的新增功能:--align_origin提供了一种简单的原点对齐,可用于漂移/环路闭合评估。这不是基于Umeyama算法。

Temporal alignment

This is done by searching the best matching timestamps between the reference and the other trajectories. All trajectories are then reduced to the best matching timestamps. If no matches are found, an error is thrown. The options for this step are:

--t_offset: add a constant timestamp offset (not adding to --ref trajectory) - default: 0.0s

--t_max_diff: maximum timestamp difference for data association - default: 0.01s

All geometric alignment methods (--align, --correct_scale) do this automatically to do point registration. You can also just synchronize the timestamps of the trajectories without any geometric alignment with --sync.

这是通过搜索参考轨迹和其他轨迹之间的最佳匹配时间戳来完成的。然后将所有轨迹缩减为最佳匹配的时间戳。如果未找到匹配项,则会引发错误。此步骤的选项包括:

--t_offset:添加一个恒定的时间戳偏移(不添加到--ref轨迹)-默认值:0.0s
--t_max_diff:数据关联的最大时间戳差异-默认值:0.01s
所有几何对齐方法(--align、--correct_scale)都会自动执行此操作以进行点配准。您也可以只同步轨迹的时间戳,而不与--sync进行任何几何对齐。

Transformations

You can also transform the poses of the trajectories with a custom 3D transformation. For this, you need a .json file with the translation vector and the rotation quaternion in this format:

也可以使用自定义三维变换来变换轨迹的姿势。为此,您需要一个.json文件,其中包含以下格式的平移矢量和旋转四元数:

{

  "x": 0.0,

  "y": 0.0,

  "z": 0.0,

  "qx": 0.0,

  "qy": 0.0,

  "qz": 0.0,

  "qw": 1.0

}

To apply such a transformation from the global frame, use --transform_left <json file>. To transform each pose from its own local frame, use --transform_right <json file> (this changes the shape of the trajectory if it includes a translation!).

要从全局框架应用这样的转换,请使用--transform_left<json file>。要从每个姿势自己的局部帧转换每个姿势,请使用--transform_right<json file>(如果包含平移,则会更改轨迹的形状!)。

Footer

Formats · MichaelGrupp/evo Wiki · GitHub

Formats

Michael Grupp edited this page on Aug 17, 2023 · 24 revisions

Michael Grupp于2023年8月17日编辑了本页。24次修订

Clone this wiki locally

https://github.com/MichaelGrupp/evo.wiki.git

Trajectories

Executables that load trajectories support different formats. You can specify the format you want to use with the mode switch (2nd argument), for example: evo_traj tum ... or evo_traj kitti .... This document provides information about these file formats.

Tip: if you don't know which format you should use for your SLAM algorithm, use the TUM format. It's simple, but can be converted to any other format later and doesn't require ROS.

加载轨迹的可执行文件支持不同的格式。您可以指定要与模式开关一起使用的格式(第二个参数),例如:evo_traj tum ...或evo_traj kitti ...本文档提供了有关这些文件格式的信息。
提示:如果您不知道SLAM算法应该使用哪种格式,请使用TUM格式。它很简单,但以后可以转换为任何其他格式,不需要ROS。

bag & bag2 - ROS1/ROS2 bagfile

Currently, bagfiles with topics that contain geometry_msgs/PoseStamped, geometry_msgs/TransformStamped, geometry_msgs/PoseWithCovarianceStamped, geometry_msgs/PointStamped and nav_msgs/Odometry messages are supported. evo only reads the trajectory, thus covariance or twist aren't used.

New since v1.9: TF topics are now also supported. You can load the trajectory of a TF transform in the command line apps with specifier <topic>:<parent_frame>.<child_frame>. E.g. evo_traj bag my_data.bag /tf:map.base_link /tf:odom.base_link will load the trajectories of the transform chains "map to base_link" and "odom to base_link" from the topic /tf.

目前,支持主题为“geometry_msgs/PoseStamped”、“geometry_msgs/TransformStamped”、“geometry_msgs/PoseWithCovarianceStamped、“geographic_msgs/PointStamped和nav_msgs/Odometry”的Bagfile。evo只读取轨迹,因此不使用协方差或扭曲。
自v1.9以来的新功能:现在也支持TF主题。您可以使用说明符<topic>:<parent_frame>在命令行应用程序中加载TF转换的轨迹<child_frame>。例如evo_traj bag my_data.bag/tf:map.base_link/tf:odom.base_link将从主题/tf加载转换链“map to base_link”和“odom to base_liink”的轨迹。

More infos:

http://wiki.ros.org/Bags

https://docs.ros.org/en/galactic/Tutorials/Ros2bag/Recording-And-Playing-Back-Data.html

http://docs.ros.org/api/geometry_msgs/html/msg/PoseStamped.html

http://docs.ros.org/api/geometry_msgs/html/msg/PointStamped.html

http://docs.ros.org/api/geometry_msgs/html/msg/PoseWithCovarianceStamped.html

http://docs.ros.org/api/geometry_msgs/html/msg/TransformStamped.html

http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html

or run: rosmsg show geometry_msgs/PoseStamped (ROS2: ros2 interface show).

euroc - EuRoC MAV dataset format (also used in TUM VI dataset)

Every sequence of the EuRoC MAV dataset has .csv files with various ground truth information. For us, only the first columns with the ground truth's trajectory are important (timestamps, positions and orientations).

You can find these files in the sequence folder: <sequence>/mav0/state_groundtruth_estimate0/data.csv

This format only makes sense for these ground truth files because they have additional data (which we don't need). If you use the EuRoC dataset, you usually need to save the trajectory in another format like the TUM format (e.g. ORB-SLAM does it like that).

In euroc mode, evo's metrics require you to give the reference in the EuRoC format and the estimated trajectory in the TUM format.

EuRoC MAV数据集的每个序列都有.csv文件,其中包含各种地面实况信息。对我们来说,只有具有地面实况轨迹的前几列才是重要的(时间戳、位置和方向)。
您可以在序列文件夹中找到这些文件:<sequence>/mav0/state_groundtruth_estimate0/data.csv
这种格式只对这些基本事实文件有意义,因为它们有额外的数据(我们不需要)。如果使用EuRoC数据集,通常需要将轨迹保存为另一种格式,如TUM格式(例如ORB-SLAM就是这样做的)。
在euroc模式中,evo的度量要求您以euroc格式提供参考,以TUM格式提供估计轨迹。

More infos:

http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets#the_euroc_mav_dataset

WARNING be careful with the EuRoC dataset coordinate frames (ground truth, IMU, camera...), because they have different axis conventions.

警告:注意EuRoC数据集坐标系(地面实况、IMU、相机…),因为它们有不同的轴约定。

kitti - KITTI dataset pose format

This is actually not a real trajectory format because it has no timestamps - it only contains the poses in a text file. This means that you have to be careful when you want to compare two files in this format with a metric because the number of poses must be exactly the same.

Every row of the file contains the first 3 rows of a 4x4 homogeneous pose matrix (SE(3) matrix) flattened into one line, with each value separated by a space. For example, this pose matrix:

a b c d

e f g h

i j k l

0 0 0 1

will appear in the file as the row:

a b c d e f g h i j k l

More infos: http://www.cvlibs.net/datasets/kitti/eval_odometry.php

这实际上不是一个真正的轨迹格式,因为它没有时间戳——它只包含文本文件中的姿势。这意味着,当您想将这种格式的两个文件与度量进行比较时,必须小心,因为姿势的数量必须完全相同。
文件的每一行都包含4x4齐次姿态矩阵(SE(3)矩阵)的前3行,这些矩阵被展平为一行,每个值由一个空格分隔。例如,此姿势矩阵:

a b c d

将在文件中显示为行:

a b c d e f g h i j k l

tum - TUM RGB-D dataset trajectory format

Every row has 8 entries containing timestamp (in seconds), position and orientation (as quaternion) with each value separated by a space:

timestamp x y z q_x q_y q_z q_w

More infos: https://vision.in.tum.de/data/datasets/rgbd-dataset/file_formats

NOTE: the TUM visual inertial dataset provides groundtruth data in a similar format like the EuRoC MAV dataset. It is not using the TUM RGB-D trajectory format for the groundtruth. With evo 1.13.4 or later you can use the euroc mode also for this dataset.

每行有8个条目,包含时间戳(以秒为单位)、位置和方向(以四元数表示),每个值用空格分隔:
timestamp x y z q_x q_y q_z q_w
注:TUM视觉惯性数据集以类似于EuRoC MAV数据集的格式提供地面实况数据。它没有将TUM RGB-D轨迹格式用于地面实况。使用evo 1.13.4或更高版本,您也可以对此数据集使用euroc模式。

Saving / Exporting to other formats

In general, you can export trajectories to other formats with evo_traj using the --save_as_<other_format> options.

The following combinations are possible:

--save_as_bag --save_as_kitti --save_as_tum --save_as_bag2
bag yes yes yes yes
euroc yes yes yes yes
kitti no (no timestamps) yes no (no timestamps)* no (no timestamps)
tum yes yes yes yes
bag2 yes yes yes yes

*... but you can use this script together with the timestamp files of the KITTI dataset

*...但是您可以将此脚本与KITTI数据集的时间戳文件一起使用

exported ROS bag files will contain geometry_msgs/PoseStamped messages

导出的ROS包文件将包含geometry_msgs/PoseStamped消息

Example:

# export a EuRoC groundtruth file to a TUM trajectory

evo_traj euroc data.csv --save_as_tum

# (will be saved as data.tum)

# export TUM trajectories to KITTI format

evo_traj tum traj_1.txt traj_2.txt traj_3.txt --save_as_kitti

# (will be saved as *.kitti)

# export TUM trajectories to ROS bagfile

evo_traj tum traj_1.txt traj_2.txt traj_3.txt --save_as_bag

# (will be saved as <timestamp>.bag with topics traj_1, traj_2 and traj_3)

# and so on...

There is no --save_as_euroc option because the EuRoC format only makes sense for the ground truth of the EuRoC dataset.

Note: Prior to version 1.0.5, there was a bug with the quaternions if TUM files were exported. Make sure your version is at least v1.0.5 with evo pkg --version or upgrade.

没有--save_as_euroc选项,因为euroc格式只对euroc数据集的基本事实有意义。
注意:在1.0.5版本之前,如果导出TUM文件,则四元数存在错误。请确保您的版本至少为v1.0.5,带有evo-pkg版本或升级版。

Result zip files for evo_res

These files generated by a metric with the --save_results option contain the data that is needed to compare different results with evo_res. They are just .zip files that contain a few .json files and .npy files for storing larger numpy arrays.

If you want, you can also store a backup of the trajectories that were used to generate the result in the .zip file. To do this automatically whenever you use --save_results, change the settings:

使用--save_results选项的度量生成的这些文件包含将不同结果与evo_res进行比较所需的数据。它们只是.zip文件,其中包含一些.json文件和.npy文件,用于存储较大的numpy数组。
如果需要,还可以将用于生成结果的轨迹的备份存储在.zip文件中。要在每次使用--save_results时自动执行此操作,请更改设置:

evo_config set save_traj_in_zip true

Note that this will increase the size of the files.

请注意,这将增加文件的大小。

参考

https://github.com/MichaelGrupp/evo/wiki/evo_traj 

Formats · MichaelGrupp/evo Wiki · GitHub

猜你喜欢

转载自blog.csdn.net/weixin_56337147/article/details/135325183