Class GyroIODual

java.lang.Object
frc.robot.subsystems.drive.gyro.GyroIODual
All Implemented Interfaces:
GyroIO

public class GyroIODual extends Object implements GyroIO
IO implementation that combines a Studica NavX and a Redux Canandgyro.

This implementation prioritizes the NavX (for low USB latency) for high-frequency odometry and Whacknet broadcasts, but utilizes the Canandgyro to calculate and correct for NavX drift across all 3 axes (Yaw, Pitch, Roll) when the robot is detected to be stationary.

  • Constructor Details

    • GyroIODual

      public GyroIODual()
      Creates a new GyroIODual.
  • Method Details

    • updateHighFreq

      public IMUState updateHighFreq(double timestampSec)
      Description copied from interface: GyroIO
      Polls high-frequency data for the 200Hz odometry loop.
      Specified by:
      updateHighFreq in interface GyroIO
      Parameters:
      timestampSec - The exact timestamp of the current 200Hz tick.
      Returns:
      The latest 6-DOF IMU state or null if the data is not available.
    • updateInputs

      public void updateInputs(GyroIO.GyroIOInputs inputs)
      Description copied from interface: GyroIO
      Updates the set of loggable inputs.
      Specified by:
      updateInputs in interface GyroIO
      Parameters:
      inputs - The inputs object to update.
    • clearFaults

      public void clearFaults()
      Description copied from interface: GyroIO
      Clears all faults and warnings.
      Specified by:
      clearFaults in interface GyroIO
    • setRotation

      public void setRotation(Rotation3d rotation)
      Description copied from interface: GyroIO
      Sets the gyro's rotation to the specified angle.
      Specified by:
      setRotation in interface GyroIO
      Parameters:
      rotation - The angle to set the gyro's rotation to.