ATE Result¶
ate_result ¶
AbsoluteTrajectoryDeviations
dataclass
¶
AbsoluteTrajectoryDeviations(
pos_dev: ndarray,
directed_pos_dev: ndarray,
rot_dev: Rotations | None = None,
rotations_used: bool = False,
)
Container holding absolute pose deviations between two trajectories.
The arrays stored in this dataclass represent per-epoch deviations after
an optional temporal/spatial alignment of a reference (ground truth) and
a test trajectory. They are later aggregated by ATEResult to derive
metrics such as mean/median Absolute Trajectory Error (ATE), directional
bias, and RMS statistics.
All deviations describe how far the evaluated (test) trajectory deviates from the reference, i.e. test minus reference: a positive x deviation means the test trajectory is further in x direction, a positive along-track deviation that it is ahead, a positive horizontal cross-track deviation that it is to the right and a positive vertical cross-track deviation that it is above.
Attributes:
-
pos_dev(ndarray) –3D array of absolute position deviation vectors in meters. Shape is (N, 3) for N deviation vectors with x, y, z components. These deviations are directly depending on the definition of the coordinate frame of the trajectories.
-
directed_pos_dev(ndarray) –3D array of directed position deviation vectors (e.g. along-track, horizontal/vertical cross-track) in meters. Shape is (N, 3). These deviations are independent of the global coordinate frame, as they are derived based on the along-track direction of the trajectory.
-
rot_dev(Rotations | None) –Optional orientation deviations represented as a
Rotationsinstance (radians), the rotation from the reference to the test orientation (test * reference^-1).Noneif rotational evaluation was not performed. -
rotations_used(bool) –Indicates whether trajectory rotation information was employed to derive the direction frame for
directed_pos_dev. If False, directional decomposition has relied on positional differences only.
ATEResult ¶
ATEResult(
trajectory: Trajectory,
abs_dev: AbsoluteTrajectoryDeviations,
name: str = "",
)
This class represents a set of absolute trajectory deviations
Absolute trajectory deviations describe absolute pose deviations between two trajectories. The deviations are calculated by comparing pairs of positions and orientations in the test and reference trajectory.
Attributes:
-
trajectory(Trajectory) –The trajectory the deviations are belonging to
-
abs_dev(AbsoluteTrajectoryDeviations) –The absolute trajectory deviations
-
name(str) –The name of the result
Source code in trajectopy\results\ate_result.py
correlation
cached
property
¶
correlation: DeviationCorrelation
Temporal correlation of the deviations: autocorrelation, correlation time and number of independent deviations of each component (cached, see DeviationCorrelation).
is_spatially_sorted
property
¶
True if the trajectory was sorted spatially, i.e. its path lengths do not follow the chronological order. Only then, ordering by path length differs from ordering by time.
index
property
¶
Returns the variable that currently parametrizes the trajectory.
Depending on the sorting of the trajectory, this is either time or arc length.
Returns:
-
ndarray–np.ndarray: Current independent variable array (time or path-length).
has_orientation
property
¶
Returns True if orientation is available.
Returns:
-
bool(bool) –True if rotation deviations are available, False otherwise.
pos_dev_cross_h
property
¶
Returns deviations of horizontal cross track deviations
pos_dev_cross_v
property
¶
Returns deviations of vertical cross track deviations
pos_dev_comb
cached
property
¶
Returns position deviations combined using the L2 norm (cached: the statistics use them several times)
rot_dev_comb
cached
property
¶
Returns rotation deviations as single rotation angles (cached: the statistics use them several times)
remove_ate_above ¶
Clips the ATE at a given value.
This is useful to remove outliers from the ATE.
Parameters:
-
threshold(float) –Maximum ATE value to keep.
Source code in trajectopy\results\ate_result.py
set_sorting ¶
Orders the trajectory and its deviations by time or path length.
Parameters:
-
sorting(Sorting) –New sorting.
Source code in trajectopy\results\ate_result.py
to_dataframe ¶
Exports results as pandas dataframe
Source code in trajectopy\results\ate_result.py
to_kml ¶
Exports the result to a Google Earth KML file: the trajectory colored by a deviation field, with playback in Google Earth's time slider. Requires a trajectory with a known EPSG code.
Parameters:
-
filename(str) –The output filename (e.g., "ate.kml").
-
field(str, default:'position') –Deviation field that colors the trajectory, e.g. "position", "x", "along_track", "rotation" or "yaw" (see :func:
trajectopy.io.kml.ate_kml_fields). Defaults to "position". -
max_std(float, default:3.0) –The color scale is clipped to mean ±
max_stdstandard deviations (0 = minimum to maximum). Defaults to 3.0. -
**options(Any, default:{}) –Further options of :func:
trajectopy.io.kml.write_ate_kml, e.g.colormap="viridis",value_range=(0.0, 0.5),heights="ellipsoidal"orextrude=True.
Source code in trajectopy\results\ate_result.py
to_file ¶
Exports the result as CSV with a metadata header.