Displacement-Based Metrics#
This document summarizes the ground-truth-comparison metrics that are written to the output bag by the open-loop evaluator.
Target metric topics:
adefdeahefhelateral_deviationlongitudinal_deviation
These metrics are computed point-wise against ground truth over the predicted trajectory. They are saved as output bag topics for the full predicted trajectory, and they are also used to derive multi-horizon results for full, 1s, 2s, 4s, and 8s.
Common Setup#
Let the predicted trajectory contain points indexed by \(i = 0, 1, \ldots, N\).
For each point \(i\):
- \((x_i^{\mathrm{pred}}, y_i^{\mathrm{pred}})\): predicted position
- \((x_i^{\mathrm{gt}}, y_i^{\mathrm{gt}})\): ground-truth position
- \(\psi_i^{\mathrm{pred}}\): predicted yaw
- \(\psi_i^{\mathrm{gt}}\): ground-truth yaw
- \(t_i\): relative timestamp of the predicted point
In this project, \(t_i\) means the time_from_start of the \(i\)-th predicted trajectory point.
For a requested horizon H, the evaluator chooses:
and only reports that horizon if:
This means horizon metrics are derived from the latest trajectory point whose time_from_start does not exceed the requested horizon, with a tolerance of 0.1s.
ADE#
Definition#
Average Displacement Error (ADE) is the average 2D position error between the predicted and ground-truth trajectories.
Official Equation#
Implemented Equation in This Project#
First define the point-wise displacement error:
The saved ade topic stores the running ADE array:
For a horizon H, the reported horizon ADE is:
Implementation Notes#
- The average starts from the first available predicted trajectory point, not from a separate global time origin.
- If the first predicted point has
time_from_start = 0.1s, then ADE starts from that point. - The output bag topic is a
Float64MultiArraycontaining the running ADE over the full trajectory. - Multi-horizon ADE values are derived from this array using the horizon cutoff.
FDE#
Definition#
Final Displacement Error (FDE) is the 2D position error at the final evaluation point.
Official Equation#
Implemented Equation in This Project#
Using the same point-wise displacement error:
the horizon FDE is:
Implementation Notes#
- The saved
fdetopic contains the point-wise displacement error arraye_i, not a running FDE. - The horizon or full-trajectory FDE is obtained by taking the cutoff element from that array.
- This is why the topic name is
fdeeven though the bag message contains one value per trajectory point.
AHE#
Definition#
Average Heading Error (AHE) is the average absolute heading difference between the predicted and ground-truth trajectories.
Official Equation#
Implemented Equation in This Project#
Define the point-wise heading error:
The saved ahe topic stores the running average heading error array:
For a horizon H, the reported horizon AHE is:
Implementation Notes#
- Heading error is stored in radians.
- The absolute heading difference is normalized before taking the magnitude.
- The output bag topic is a
Float64MultiArraycontaining the running AHE over the full trajectory.
FHE#
Definition#
Final Heading Error (FHE) is the absolute heading error at the final evaluation point.
Official Equation#
Implemented Equation in This Project#
Using the point-wise heading error:
the horizon FHE is:
Implementation Notes#
- The saved
fhetopic contains the point-wise heading error arrayh_i, not a running FHE. - The horizon or full-trajectory FHE is obtained by taking the cutoff element from that array.
- This mirrors how
fdeis handled for position error.
Lateral Deviation#
Definition#
Lateral deviation is the signed lateral position error between prediction and ground truth, measured in the ground-truth vehicle frame.
Implemented Equation in This Project#
First compute the global position difference:
Then rotate this difference by \(-\psi_i^{\mathrm{gt}}\) into the ground-truth vehicle frame:
The implemented lateral deviation is:
For a horizon H, the evaluator derives:
Implementation Notes#
- The saved
lateral_deviationtopic contains the signed point-wise lateral deviation array. - The horizon metrics use absolute values when computing average and max aggregates.
- This metric is different from route-centerline lateral deviation used by lane-keeping logic.
Longitudinal Deviation#
Definition#
Longitudinal deviation is the signed longitudinal position error between prediction and ground truth, measured in the ground-truth vehicle frame.
Implemented Equation in This Project#
Using the same rotated vehicle-frame offset as above, the implemented longitudinal deviation is:
For a horizon H, the evaluator derives:
Implementation Notes#
- The saved
longitudinal_deviationtopic contains the signed point-wise longitudinal deviation array. - The horizon metrics use absolute values when computing average and max aggregates.
Output Bag Topics#
The following ground-truth-comparison metric topics are written to the output bag:
adefdeahefhelateral_deviationlongitudinal_deviation
All of the above are written as std_msgs/msg/Float64MultiArray.
Horizon-Derived Results#
The following multi-horizon results are derived from the arrays above for full, 1s, 2s, 4s, and 8s:
ADEFDEAHEFHEaverage_lateral_deviationmax_lateral_deviationaverage_longitudinal_deviationmax_longitudinal_deviation
These horizon results are stored in the structured result JSON written by the evaluator, rather than as separate per-horizon bag topics.