Record Class PoseObservation
java.lang.Object
java.lang.Record
frc.spectrumLib.localization.PoseObservation
- Record Components:
source- source name, e.g."LL-Back/MT1","Orin-Left","Quest"kind- what produced it, which decides which gates and std-dev model applytimestampSeconds- capture time, in the same time base asTimer.getTimestamp()pose- robot pose on the field (3-D, so tilt and height gates can see a bad solve)tagCount- AprilTags in the solve, or-1for a source with no tagsavgTagDistanceMeters- mean camera-to-tag distance, orNaNtargetSizePercent- Limelight target area as a percentage of the image, orNaNmaxAmbiguity- largest single-tag ambiguity in the solve (0..1), orNaNtracking- VIO tracking flag;truefor sources that have no such notionstdDevScale- multiplier the source's trust model applies to its std-devs, e.g. the Orin's image-edge and per-camera factors; 1 for sources without one
public record PoseObservation(String source, PoseObservation.Kind kind, double timestampSeconds, Pose3d pose, int tagCount, double avgTagDistanceMeters, double targetSizePercent, double maxAmbiguity, boolean tracking, double stdDevScale)
extends Record
One robot-pose measurement from one source, before any gating.
This is the 2026 Vision.VisionFieldPoseEstimate (pose + timestamp + covariance)
promoted out of Vision, with the fields every gate in the 2026 code actually read made
explicit, a source so the fused log can say where each measurement came from, and tagCount optional so a VIO source like QuestNav fits the same shape.
Every field here is derived from a logged AdvantageKit input, so a replayed log rebuilds the exact same observations and a gate threshold can be changed and re-run against a real match.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPoseObservation(String source, PoseObservation.Kind kind, double timestampSeconds, Pose3d pose, int tagCount, double avgTagDistanceMeters, double targetSizePercent, double maxAmbiguity, boolean tracking) An observation with no std-dev scaling.PoseObservation(String source, PoseObservation.Kind kind, double timestampSeconds, Pose3d pose, int tagCount, double avgTagDistanceMeters, double targetSizePercent, double maxAmbiguity, boolean tracking, double stdDevScale) Creates an instance of aPoseObservationrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theavgTagDistanceMetersrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.doubleReturns the value of themaxAmbiguityrecord component.booleanmultiTag()Whether the solve used more than one tag.pose()Returns the value of theposerecord component.pose2d()The pose flattened to the field plane.source()Returns the value of thesourcerecord component.doubleReturns the value of thestdDevScalerecord component.inttagCount()Returns the value of thetagCountrecord component.doubleReturns the value of thetargetSizePercentrecord component.doubleReturns the value of thetimestampSecondsrecord component.final StringtoString()Returns a string representation of this record class.booleantracking()Returns the value of thetrackingrecord component.
-
Constructor Details
-
PoseObservation
public PoseObservation(String source, PoseObservation.Kind kind, double timestampSeconds, Pose3d pose, int tagCount, double avgTagDistanceMeters, double targetSizePercent, double maxAmbiguity, boolean tracking) An observation with no std-dev scaling. -
PoseObservation
public PoseObservation(String source, PoseObservation.Kind kind, double timestampSeconds, Pose3d pose, int tagCount, double avgTagDistanceMeters, double targetSizePercent, double maxAmbiguity, boolean tracking, double stdDevScale) Creates an instance of aPoseObservationrecord class.- Parameters:
source- the value for thesourcerecord componentkind- the value for thekindrecord componenttimestampSeconds- the value for thetimestampSecondsrecord componentpose- the value for theposerecord componenttagCount- the value for thetagCountrecord componentavgTagDistanceMeters- the value for theavgTagDistanceMetersrecord componenttargetSizePercent- the value for thetargetSizePercentrecord componentmaxAmbiguity- the value for themaxAmbiguityrecord componenttracking- the value for thetrackingrecord componentstdDevScale- the value for thestdDevScalerecord component
-
-
Method Details
-
pose2d
The pose flattened to the field plane. -
multiTag
public boolean multiTag()Whether the solve used more than one tag. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
source
-
kind
-
timestampSeconds
public double timestampSeconds()Returns the value of thetimestampSecondsrecord component.- Returns:
- the value of the
timestampSecondsrecord component
-
pose
-
tagCount
-
avgTagDistanceMeters
public double avgTagDistanceMeters()Returns the value of theavgTagDistanceMetersrecord component.- Returns:
- the value of the
avgTagDistanceMetersrecord component
-
targetSizePercent
public double targetSizePercent()Returns the value of thetargetSizePercentrecord component.- Returns:
- the value of the
targetSizePercentrecord component
-
maxAmbiguity
public double maxAmbiguity()Returns the value of themaxAmbiguityrecord component.- Returns:
- the value of the
maxAmbiguityrecord component
-
tracking
-
stdDevScale
public double stdDevScale()Returns the value of thestdDevScalerecord component.- Returns:
- the value of the
stdDevScalerecord component
-