Main Content

compareTrajectories

Compare estimated trajectory against ground truth

Since R2024b

Description

metrics = compareTrajectories(estimatedPoses,groundTruthPose) returns metrics for the accuracy of an estimated trajectory, estimatedPoses, against a ground truth trajectory groundTruthPose, to assess the performance of an odometry or a Simultaneous Localization and Mapping (SLAM) system.

The function aligns the estimated trajectory to the ground truth trajectory by performing a least-square fitting between the translation components of poses in the two trajectories.

metrics = compareTrajectories(___,Name=Value) specifies options using one or more name-value arguments in addition to the previous syntaxes. For example, AlignmentType="none" sets the transformation type to "none" when aligning the estimated trajectory to the ground truth trajectory.

Input Arguments

collapse all

Estimated poses, specified as an M-element array of rigidtform3d objects. The estimated poses can be obtained from an odometry or a SLAM system.

Ground truth poses, specified as an M-element array of rigidtform3d objects. The ground truth poses are obtained from an external ground truth system.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: compareTrajectories(estimatedPoses,groundTruthPose,AlignmentType="none") sets the transformation type to "none" when aligning the estimated trajectory to the ground truth trajectory.

Transformation type to align the estimated trajectory to the ground truth trajectory, specified as "rigid", "similarity", or "none". To disable trajectory alignment, set AlignmentType to "none".

Fixed distance to compute relative trajectory error for each pose within the estimated trajectory, specified as a scalar in world units.

Output Arguments

collapse all

Error metrics object, returned as an trajectoryErrorMetrics object. The object stores error metrics including the absolute trajectory error and the relative trajectory error.

References

[1] Sturm, Jürgen, Nikolas Engelhard, Felix Endres, Wolfram Burgard, and Daniel Cremers. 2012. "A Benchmark for the Evaluation of RGB-D SLAM Systems." In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems, 573-580.

[2] Zhang, Zichao, and Davide Scaramuzza. 2018. "A Tutorial on Quantitative Trajectory Evaluation for Visual (-Inertial) Odometry." In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems, 7244-7251.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2024b