Fix PoseObservation serialization for AdvantageKit replay#662
Open
aschokking wants to merge 1 commit intomainfrom
Open
Fix PoseObservation serialization for AdvantageKit replay#662aschokking wants to merge 1 commit intomainfrom
aschokking wants to merge 1 commit intomainfrom
Conversation
Matrix<N3, N1> has no static struct field, so AdvantageKit's RecordStruct silently drops the estimatedStdDevs field during logging, causing data loss and replay crashes. Replace it with three separate doubles (stdDev0, stdDev1, stdDev2) in the PoseObservation record, which RecordStruct can serialize natively. IO implementations and tests unpack/repack at the record boundary; the rest of the codebase continues using Matrix<N3, N1>. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rokadias
reviewed
Mar 25, 2026
| VecBuilder.fill(0.02, 0.02, 0.6), // This is from LinearStdDevBaseline, and AngularStdDevBaseline from the old way. | ||
| 0.02, 0.02, 0.6, // This is from LinearStdDevBaseline, and AngularStdDevBaseline from the old way. | ||
| PoseObservationType.PHOTONVISION)); // Observation type | ||
|
|
Contributor
There was a problem hiding this comment.
It might be better to just delete this class rather than maintain it.
I think with several matches under it's belt now. AprilTagVisionIOPhotonVisionEstimator is now the king, all hail the new king.
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.
Why are we doing this?
Whats changing?
Claude:
PoseObservation contained a Matrix<N3, N1> estimatedStdDevs field. AdvantageKit's RecordStruct serializes records by
reflecting on each component type and looking for a static struct field. Matrix<N3, N1> doesn't have one, so AKit
silently drops estimatedStdDevs during logging and throws errors during replay deserialization.
Fix
Replace Matrix<N3, N1> estimatedStdDevs in the PoseObservation record with three separate double fields (stdDev0,
stdDev1, stdDev2), which RecordStruct can serialize natively.
The change is kept as narrow as possible:
only at the new PoseObservation(...) call site
VisionPoseObservation
Questions/notes for reviewers
How this was tested