Record Class PoseFrame

java.lang.Object
java.lang.Record
gg.questnav.questnav.PoseFrame
Record Components:
questPose3d - The robot's pose on the field as measured by the Quest tracking system. This will only provide meaningful field-relative coordinates after QuestNav.setPose(Pose2d) has been called to establish the field reference frame.
dataTimestamp - The NetworkTables timestamp indicating when this frame data was received by the robot. This timestamp should be used when adding vision measurements to pose estimators as it represents when the measurement was available to the robot code. Units: seconds since robot program start.
appTimestamp - The Quest application's internal timestamp indicating when this frame was generated. This is primarily useful for debugging timing issues and calculating Quest-side latency. For pose estimation, use dataTimestamp() instead. Units: seconds since Quest app startup.
frameCount - Sequential frame number from the Quest tracking system. This counter increments with each tracking frame and can be used to detect dropped frames or measure effective frame rate. Resets to 0 when the Quest app restarts.

public record PoseFrame(edu.wpi.first.math.geometry.Pose3d questPose3d, double dataTimestamp, double appTimestamp, int frameCount) extends Record
Represents a single frame of pose tracking data received from the Quest headset.

This record encapsulates all the information needed to integrate Quest tracking data with FRC pose estimation systems. Each frame represents a single tracking measurement from the Quest's visual-inertial odometry system.

Usage with Pose Estimators

This record is designed to work seamlessly with WPILib's pose estimation framework:


 PoseFrame[] frames = questNav.getAllUnreadPoseFrames();
 for (PoseFrame frame : frames) {
   if (questNav.isTracking()) {
     poseEstimator.addVisionMeasurement(
       frame.questPose(),      // Use the pose measurement
       frame.dataTimestamp(),  // Use the NetworkTables timestamp
       standardDeviations      // Your measurement uncertainty
     );
   }
 }
 

Timestamp Usage

Two timestamps are provided for different use cases:

  • dataTimestamp(): NetworkTables reception time - use this for pose estimation
  • appTimestamp(): Quest internal time - use only for debugging/diagnostics

Coordinate System

The pose data follows WPILib field coordinate conventions:

  • X-axis: Forward (towards opposing alliance)
  • Y-axis: Left (when facing forward)
  • Rotation: Counter-clockwise positive
  • Units: Meters for translation, radians for rotation
Since:
2025.1.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PoseFrame(edu.wpi.first.math.geometry.Pose3d questPose3d, double dataTimestamp, double appTimestamp, int frameCount)
    Creates an instance of a PoseFrame record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the appTimestamp record component.
    double
    Returns the value of the dataTimestamp record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the frameCount record component.
    final int
    Returns a hash code value for this object.
    edu.wpi.first.math.geometry.Pose3d
    Returns the value of the questPose3d record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PoseFrame

      public PoseFrame(edu.wpi.first.math.geometry.Pose3d questPose3d, double dataTimestamp, double appTimestamp, int frameCount)
      Creates an instance of a PoseFrame record class.
      Parameters:
      questPose3d - the value for the questPose3d record component
      dataTimestamp - the value for the dataTimestamp record component
      appTimestamp - the value for the appTimestamp record component
      frameCount - the value for the frameCount record component
  • Method Details

    • 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 '=='.
      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.
    • questPose3d

      public edu.wpi.first.math.geometry.Pose3d questPose3d()
      Returns the value of the questPose3d record component.
      Returns:
      the value of the questPose3d record component
    • dataTimestamp

      public double dataTimestamp()
      Returns the value of the dataTimestamp record component.
      Returns:
      the value of the dataTimestamp record component
    • appTimestamp

      public double appTimestamp()
      Returns the value of the appTimestamp record component.
      Returns:
      the value of the appTimestamp record component
    • frameCount

      public int frameCount()
      Returns the value of the frameCount record component.
      Returns:
      the value of the frameCount record component