Skip to content

evalio.stats

Error dataclass

Dataclass to hold the error between two trajectories. Generally output from computing ate or rte.

Contains a (n,) arrays of translation and rotation errors.

rot instance-attribute

rot: ndarray

rotation error, shape (n,), in degrees

trans instance-attribute

trans: ndarray

translation error, shape (n,), in meters

mean

mean() -> Metric

Compute the mean of the errors.

median

median() -> Metric

Compute the median of the errors.

sse

sse() -> Metric

Compute the sqrt of sum of squared errors.

summarize

summarize(metric: MetricKind) -> Metric

How to summarize the vector of errors.

Parameters:

  • metric (MetricKind) –

    The metric to use for summarizing the error, either mean, median, or sse.

Returns:

  • Metric ( Metric ) –

    The summarized error

Metric dataclass

Simple dataclass to hold the resulting metrics. Likely output from Error.

rot instance-attribute

rot: float

rotation error in degrees

trans instance-attribute

trans: float

translation error in meters

MetricKind

Bases: StrEnum

Simple enum to define the metric to use for summarizing the error. Used in Error.

mean class-attribute instance-attribute

mean = auto()

Mean

median class-attribute instance-attribute

median = auto()

Median

sse class-attribute instance-attribute

sse = auto()

Sqrt of Sum of squared errors

align

align(
    traj: Trajectory, gt: Trajectory, in_place: bool = False
) -> tuple[Trajectory, Trajectory]

Align the trajectories both spatially and temporally.

The resulting trajectories will be have the same origin as the second ("gt") trajectory. See align_poses and align_stamps for more details.

Parameters:

  • traj (Trajectory) –

    One of the trajectories to align.

  • gt (Trajectory) –

    The other trajectory to align to.

  • in_place (bool, default: False ) –

    If true, the original trajectory will be modified. Defaults to False.

align_poses

align_poses(traj: Trajectory, other: Trajectory)

Align the trajectory in place to another trajectory. Operates in place.

This results in the current trajectory having an identical first pose to the other trajectory. Assumes the first pose of both trajectories have the same stamp.

Parameters:

  • traj (Trajectory) –

    The trajectory that will be modified

  • other (Trajectory) –

    The trajectory to align to.

align_stamps

align_stamps(traj1: Trajectory, traj2: Trajectory)

Select the closest poses in traj1 and traj2. Operates in place.

Does this by finding the higher frame rate trajectory and subsampling it to the closest poses of the other one. Additionally it checks the beginning of the trajectories to make sure they start at about the same stamp.

Parameters:

ate

ate(traj: Trajectory, gt: Trajectory) -> Error

Compute the Absolute Trajectory Error (ATE) between two trajectories.

Will check if the two trajectories are aligned and if not, will align them. Will not modify the original trajectories.

Parameters:

Returns:

  • Error ( Error ) –

    The computed error

rte

rte(
    traj: Trajectory, gt: Trajectory, window: int = 100
) -> Error

Compute the Relative Trajectory Error (RTE) between two trajectories.

Will check if the two trajectories are aligned and if not, will align them. Will not modify the original trajectories.

Parameters:

  • traj (Trajectory) –

    One of the trajectories

  • gt (Trajectory) –

    The other trajectory

  • window (int, default: 100 ) –

    Window size for the RTE. Defaults to 100.

Returns:

  • Error ( Error ) –

    The computed error