Class OculusPoseSource

java.lang.Object
frc.alotobots.library.subsystems.vision.oculus.util.OculusPoseSource
All Implemented Interfaces:
PoseSource

public class OculusPoseSource extends Object implements PoseSource
Adapts the Meta Quest SLAM system to the standardized PoseSource interface.

This class wraps the OculusSubsystem to provide high-frequency pose estimation through the standardized PoseSource interface. The Quest serves as: - Primary pose estimation source - High-frequency (120Hz) updates - Global SLAM-based localization - Drift-free position tracking

Features: - Sub-millimeter tracking precision - Building-scale SLAM mapping - Robust to reflective surfaces - Fast relocalization from saved maps - High-speed movement handling

  • Field Details

    • subsystem

      public final OculusSubsystem subsystem
      The underlying Oculus subsystem
  • Constructor Details

    • OculusPoseSource

      public OculusPoseSource(OculusSubsystem subsystem)
      Creates a new OculusPoseSource.
      Parameters:
      subsystem - The Oculus subsystem to wrap
  • Method Details

    • isConnected

      public boolean isConnected()
      Checks if the pose source is currently connected and providing valid data.

      This method should: - Verify hardware connectivity (if applicable) - Check data freshness - Validate sensor readings - Monitor update frequency

      For Quest SLAM, connection status depends on: - Quest hardware connection - SLAM tracking quality - Update frequency - Environment mapping status

      Specified by:
      isConnected in interface PoseSource
      Returns:
      true if the source is connected and providing valid data
    • getCurrentPose

      public Pose2d getCurrentPose()
      Gets the most recent pose estimate from this source.

      The returned pose should be: - In field-relative coordinates - Using the standard FRC coordinate system: - Origin at field corner - +X towards opposite alliance wall - +Y towards driver station - CCW positive rotation

      If no valid pose is available, returns null.

      Quest poses are: - Globally consistent via SLAM - Updated at 120Hz - Drift-compensated - Environment-referenced - Transform-corrected to field frame

      Specified by:
      getCurrentPose in interface PoseSource
      Returns:
      The current robot pose estimate, or null if unavailable
    • getStdDevs

      public Matrix<N3,N1> getStdDevs()
      Gets the standard deviations of measurement uncertainty for this pose source.

      Returns a 3x1 matrix containing standard deviations for: - X position (meters) - Y position (meters) - Rotation (radians)

      These values should: - Reflect real measurement uncertainty - Scale with distance/conditions - Account for systematic errors - Consider environmental factors

      Quest measurement uncertainty: - Sub-millimeter position accuracy - Factory-calibrated IMU - Environment-dependent SLAM quality - Constant across operating range

      Specified by:
      getStdDevs in interface PoseSource
      Returns:
      3x1 matrix of standard deviations [x, y, theta]
    • getSourceName

      public String getSourceName()
      Gets a human-readable identifier for this pose source.

      Used for: - Logging - Debugging - User interfaces - Status reporting

      Specified by:
      getSourceName in interface PoseSource
      Returns:
      String identifier for this pose source