Repository navigation
Score localization estimates against truth at their capture time - #12
Merged
Merged
Conversation
The localization error compared the latest estimate with the latest truth. An estimate is always older than the current truth, so latency counted as position error. A perfect estimate 30 ms late at 3 m/s scored 9 cm. The runtime now keeps 10 s of truth odometry. Each estimate is compared with truth at the estimate's header stamp, interpolated between steps. The error overlay line uses the same truth sample. The error also reports headingRad (estimate yaw minus truth yaw) and truthCaptureTimeNs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the hand-written quaternion lerp, yaw extraction and angle wrap with Vector3.lerpVectors, Quaternion.slerp and Euler. The heading error is now the yaw of the rotation from truth to estimate, which needs no wrap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CandidateOutputRuntimecompared the latest localization estimate with the latest truth odometry.refreshOracleruns every step and recomputes the error with the newest truth. An estimate is always older than that truth, so its latency counted as position error.Measured with a perfect estimate that arrives 30 ms late, at 3 m/s in a 0.3 rad/s turn, 10 ms step:
mainThe error is about speed × latency. With the 10–40 ms latencies seen from an external filter through the orchestrator, that is 3–12 cm at 3 m/s.
Fix
Vector3.lerpVectorsand orientation usesQuaternion.slerp.localization.truthholds that matched truth sample, so the overlay's error line joins the estimate to the truth at the same instant.headingRadandtruthCaptureTimeNs.headingRadis the yaw of the rotation from truth to estimate, from a Three.js ZYXEuler, in (-π, π]. Existing fields are unchanged.Tests
CandidateOutputRuntime, outside the repo:main)npm teston a clean checkout: 1964 pass, 6 skipped, 1 fail. The failure isPython decodes retained RGB, depth, and CameraInfo SFLog messages, which also fails onmain.Not in this PR
Speed error, and NEES (a check of the estimate's covariance against its actual error).
🤖 Generated with Claude Code