ATE vs RPE Trajectory Metrics: Understanding the Difference in SLAM Evaluation

TLDR: ATE measures global trajectory accuracy after Sim(3) alignment, while RPE measures local consistency between consecutive frames, providing complementary insights into SLAM system performance.

The LingBot-Map repository implements both ATE (Absolute Trajectory Error) and RPE (Relative Pose Error) metrics in benchmark/benchmark/evaluation/trajectory.py to evaluate camera-pose estimates. Understanding the difference between these trajectory metrics is essential for diagnosing whether errors stem from global drift or local inconsistency in visual odometry pipelines.

What is ATE (Absolute Trajectory Error)?

Absolute Trajectory Error (ATE) measures the global deviation of an estimated trajectory from ground truth after an optimal Sim(3) alignment (translation, rotation, and scale). It provides a single scalar value that reflects the overall accuracy of the entire trajectory.

In benchmark/benchmark/evaluation/trajectory.py, the implementation uses the evo library to compute ATE:


# Sim(3) alignment occurs here

traj_est_aligned.align(...)

# ATE calculation using absolute pose error (APE)

evo.main_ape.ape(traj_ref, traj_est_aligned, 
                 pose_relation=PoseRelation.translation_part)

The RMSE of the translation part is returned as the ate metric【/cache/repos/github.com/Robbyant/lingbot-map/main/benchmark/benchmark/evaluation/trajectory.py#L79-L89】. This global alignment compensates for any initial pose or scale differences, isolating the pure trajectory shape error.

What is RPE (Relative Pose Error)?

Relative Pose Error (RPE) measures local drift between successive frames, quantifying how well the relative motion between frame i and frame i + Δ is reproduced. Unlike ATE, RPE evaluates short-term consistency independent of global alignment.

The LingBot-Map implementation splits RPE into two components:

  • Rotation error: Computed using evo.main_rpe.rpe with pose_relation=PoseRelation.rotation_angle_deg【/cache/repos/github.com/Robbyant/lingbot-map/main/benchmark/benchmark/evaluation/trajectory.py#L90-L98】
  • Translation error: Computed using evo.main_rpe.rpe with pose_relation=PoseRelation.translation_part【/cache/repos/github.com/Robbyant/lingbot-map/main/benchmark/benchmark/evaluation/trajectory.py#L104-L112】

Both calculations use delta=1 to evaluate only adjacent frames, respecting the same alignment settings as ATE when self.align is enabled.

Why Both Metrics Matter Together

While ATE tells you how far the reconstructed path deviates from the true path after the best possible similarity transform, RPE reveals how consistently the algorithm predicts motion between neighboring frames.

A low ATE can mask significant local drift if the global alignment absorbs errors. Conversely, high RPE indicates frame-to-frame instability that could cause jitter or failure in applications requiring smooth motion. Together, they provide a comprehensive diagnostic: ATE for overall accuracy, RPE for local stability.

Practical Implementation in LingBot-Map

The repository provides the TrajectoryEvaluator class to streamline metric computation. Below is a minimal example demonstrating how to calculate both ATE and RPE trajectory metrics:

from pathlib import Path
from lingbot_map.utils.load_fn import BSSLoader
from benchmark.benchmark.evaluation.trajectory import TrajectoryEvaluator

# Prepare loaders for ground-truth and predicted trajectories

gt_loader = BSSLoader(Path("data/ground_truth"))
pred_loader = BSSLoader(Path("outputs/my_method"))

# Create evaluator with Sim(3) alignment enabled

evaluator = TrajectoryEvaluator(align=True, correct_scale=True)

# Run evaluation - returns dict with ATE & RPE values

metrics = evaluator.evaluate(gt_loader, pred_loader)

print("Absolute Trajectory Error (ATE):", metrics["ate"])
print("Relative Pose Error - translation:", metrics["rpe_trans"])
print("Relative Pose Error - rotation (deg):", metrics["rpe_rot"])

The same class generates trajectory visualizations:

evaluator.save_visualization(
    gt_loader,
    pred_loader,
    output_dir=Path("results/vis")
)

These code paths exercise the exact evo library calls that compute ATE and RPE, as defined in the repository's pyproject.toml dependencies.

Summary

  • ATE measures global trajectory accuracy after optimal Sim(3) alignment, returning a single RMSE value for the translation component.
  • RPE evaluates local consistency between adjacent frames (delta=1), split into separate rotation (degrees) and translation (meters) components.
  • The LingBot-Map implementation relies on the evo library, wrapping evo.main_ape.ape for ATE and evo.main_rpe.rpe for RPE.
  • Use ATE to assess overall SLAM accuracy and RPE to diagnose frame-to-frame drift and short-term stability.
  • Both metrics are accessible through the TrajectoryEvaluator class in benchmark/benchmark/evaluation/trajectory.py.

Frequently Asked Questions

When should I prioritize ATE over RPE?

Use ATE when you need to evaluate the final map quality or global path accuracy, such as in large-scale mapping or autonomous navigation where the end-to-end path accuracy matters more than intermediate wobbles. ATE is the standard metric for benchmark leaderboards comparing SLAM systems.

What does delta=1 mean in RPE calculation?

The delta=1 parameter specifies that RPE calculates error between consecutive frames only (frame i and frame i+1). Larger delta values would compare frames separated by multiple time steps, which is useful for analyzing drift over specific temporal windows or distances.

How does Sim(3) alignment affect ATE results?

Sim(3) alignment (similarity transform) optimizes the 7 degrees of freedom (translation, rotation, scale) to best fit the estimated trajectory to ground truth before computing error. This removes initialization errors and scale ambiguities, ensuring ATE measures only the intrinsic trajectory shape accuracy rather than global coordinate system differences.

Can RPE detect errors that ATE misses?

Yes. RPE can reveal local drift, jitter, or scale inconsistencies that get absorbed by the global alignment in ATE. For example, if a SLAM system oscillates around the true path but returns to the correct end position, ATE might appear low while RPE exposes the frame-to-frame instability.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →