Skip to content

RPE Result

rpe_result

RelativeTrajectoryDeviations dataclass

RelativeTrajectoryDeviations(
    pos_dev: dict[float, ndarray],
    rot_dev: dict[float, ndarray],
    pair_distance: dict[float, ndarray],
    pair_distance_unit: PairDistanceUnit = METER,
)

Container holding relative (drift) pose deviations grouped by separation.

Relative deviations quantify drift between pose pairs separated by a certain spatial distance (meters) or temporal offset (seconds). Each key in the dictionaries corresponds to a separation value (bucket) and its list contains per-pair drift samples for that bucket.

Attributes:

  • pos_dev (Dict[float, ndarray]) –

    Mapping from pair distance to the position drift magnitudes. Units depend on pair_distance_unit; values are normalized per 100 m (expressed as percentage) when distance-based.

  • rot_dev (Dict[float, ndarray]) –

    Mapping from pair distance to the orientation drift samples in radians.

  • pair_distance (Dict[float, ndarray]) –

    Raw separation measurements (meters or seconds) for each bucket, used for computing mean bucket spacing and step size.

  • pair_distance_unit (PairDistanceUnit) –

    Enumeration indicating whether bucket keys represent spatial separation (METER) or temporal separation (SECOND). Affects drift normalization and reporting units in RPEResult.

Properties

num_pairs (int): Total number of evaluated pose pairs across all buckets.

RPEResult

RPEResult(rpe_dev: RelativeTrajectoryDeviations, name: str)

This class represents a set of relative trajectory deviations

Relative trajectory deviations describe relative pose deviations between two trajectories. The deviations are calculated by comparing pairs of positions and orientations in the test and reference trajectory.

Attributes:

Source code in trajectopy\results\rpe_result.py
def __init__(
    self,
    rpe_dev: RelativeTrajectoryDeviations,
    name: str,
) -> None:
    self.name = name
    self.rpe_dev = rpe_dev

rot_rpe property

rot_rpe: float

Returns the average rotation drift in radians per 100 meters.

Returns:

  • float ( float ) –

    Average rotation drift.

property_dict property

property_dict: dict[str, str]

Returns a dictionary containing the properties of the deviation set.

This is relevant for time based comparisons, when pose-pairs are defined by a time difference.

Returns:

  • dict[str, str] –

    Dict[str, str]: Dictionary of property names and values.

to_file

to_file(filename: str, mode: str = 'a') -> None

Exports the result as CSV with a metadata header.

Source code in trajectopy\results\rpe_result.py
def to_file(self, filename: str, mode: str = "a") -> None:
    """Exports the result as CSV with a metadata header."""
    from trajectopy.io import results_io

    results_io.write_rpe_result(self, filename, mode=mode)

from_file classmethod

from_file(filename: str) -> RPEResult

Reads an RPE result from a file.

Source code in trajectopy\results\rpe_result.py
@classmethod
def from_file(cls, filename: str) -> "RPEResult":
    """Reads an RPE result from a file."""
    from trajectopy.io import results_io

    return results_io.read_rpe_result(filename)