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 apply
timestampSeconds - capture time, in the same time base as Timer.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 -1 for a source with no tags
avgTagDistanceMeters - mean camera-to-tag distance, or NaN
targetSizePercent - Limelight target area as a percentage of the image, or NaN
maxAmbiguity - largest single-tag ambiguity in the solve (0..1), or NaN
tracking - VIO tracking flag; true for sources that have no such notion
stdDevScale - 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.

  • 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 a PoseObservation record class.
      Parameters:
      source - the value for the source record component
      kind - the value for the kind record component
      timestampSeconds - the value for the timestampSeconds record component
      pose - the value for the pose record component
      tagCount - the value for the tagCount record component
      avgTagDistanceMeters - the value for the avgTagDistanceMeters record component
      targetSizePercent - the value for the targetSizePercent record component
      maxAmbiguity - the value for the maxAmbiguity record component
      tracking - the value for the tracking record component
      stdDevScale - the value for the stdDevScale record component
  • Method Details

    • pose2d

      public Pose2d pose2d()
      The pose flattened to the field plane.
    • multiTag

      public boolean multiTag()
      Whether the solve used more than one tag.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • kind

      public PoseObservation.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • timestampSeconds

      public double timestampSeconds()
      Returns the value of the timestampSeconds record component.
      Returns:
      the value of the timestampSeconds record component
    • pose

      public Pose3d pose()
      Returns the value of the pose record component.
      Returns:
      the value of the pose record component
    • tagCount

      public int tagCount()
      Returns the value of the tagCount record component.
      Returns:
      the value of the tagCount record component
    • avgTagDistanceMeters

      public double avgTagDistanceMeters()
      Returns the value of the avgTagDistanceMeters record component.
      Returns:
      the value of the avgTagDistanceMeters record component
    • targetSizePercent

      public double targetSizePercent()
      Returns the value of the targetSizePercent record component.
      Returns:
      the value of the targetSizePercent record component
    • maxAmbiguity

      public double maxAmbiguity()
      Returns the value of the maxAmbiguity record component.
      Returns:
      the value of the maxAmbiguity record component
    • tracking

      public boolean tracking()
      Returns the value of the tracking record component.
      Returns:
      the value of the tracking record component
    • stdDevScale

      public double stdDevScale()
      Returns the value of the stdDevScale record component.
      Returns:
      the value of the stdDevScale record component