evalio.stats
Classes:
-
Error–Dataclass to hold the error between two trajectories.
-
Metric–Simple dataclass to hold the resulting metrics. Likely output from Error.
-
MetricKind–Simple enum to define the metric to use for summarizing the error. Used in Error.
-
WindowMeters–Dataclass to hold the parameters for a distance-based window.
-
WindowSeconds–Dataclass to hold the parameters for a time-based window.
Functions:
-
align–Align the trajectories both spatially and temporally.
-
align_poses–Align the trajectory in place to another trajectory. Operates in place.
-
align_stamps–Select the closest poses in traj1 and traj2. Operates in place.
-
ate–Compute the Absolute Trajectory Error (ATE) between two trajectories.
-
rte–Compute the Relative Trajectory Error (RTE) between two trajectories.
Attributes:
-
WindowKind–Type alias for either a WindowMeters or a WindowSeconds.
WindowKind
module-attribute
WindowKind = WindowMeters | WindowSeconds
Type alias for either a WindowMeters or a WindowSeconds.
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.
Methods:
-
mean–Compute the mean of the errors.
-
median–Compute the median of the errors.
-
sse–Compute the sqrt of sum of squared errors.
-
summarize–How to summarize the vector of errors.
Attributes:
-
rot(NDArray[float64]) –rotation error, shape (n,), in degrees
-
trans(NDArray[float64]) –translation error, shape (n,), in meters
Source code in python/evalio/stats.py
mean
mean() -> Metric
median
median() -> Metric
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–The summarized error
Source code in python/evalio/stats.py
Metric
dataclass
Simple dataclass to hold the resulting metrics. Likely output from Error.
Attributes:
Source code in python/evalio/stats.py
MetricKind
Bases: StrEnum
Simple enum to define the metric to use for summarizing the error. Used in Error.
Attributes:
Source code in python/evalio/stats.py
WindowMeters
dataclass
WindowSeconds
dataclass
align
align(
traj: Trajectory[M1],
gt: Trajectory[M2],
in_place: bool = False,
) -> tuple[Trajectory[M1], Trajectory[M2]]
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.
Source code in python/evalio/stats.py
align_poses
align_poses(traj: Trajectory[M1], other: Trajectory[M2])
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.
Source code in python/evalio/stats.py
align_stamps
align_stamps(traj1: Trajectory[M1], traj2: Trajectory[M2])
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:
-
traj1(Trajectory) –One trajectory
-
traj2(Trajectory) –Other trajectory
Source code in python/evalio/stats.py
ate
ate(traj: Trajectory[M1], gt: Trajectory[M2]) -> 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:
-
traj(Trajectory) –One of the trajectories
-
gt(Trajectory) –The other trajectory
Returns:
-
Error–The computed error
Source code in python/evalio/stats.py
rte
rte(
traj: Trajectory[M1],
gt: Trajectory[M2],
window: WindowKind = WindowMeters(30),
) -> 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(WindowKind, default:WindowMeters(30)) –The window to use for computing the RTE. Either a WindowMeters or a WindowSeconds. Defaults to WindowMeters(30), which is a 30 meter window.
Returns: The computed error
Source code in python/evalio/stats.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |