Package swervelib.imu

Class ADIS16470Swerve

java.lang.Object
swervelib.imu.SwerveIMU
swervelib.imu.ADIS16470Swerve

public class ADIS16470Swerve extends SwerveIMU
IMU Swerve class for the ADIS16470_IMU device.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final edu.wpi.first.wpilibj.ADIS16470_IMU
    ADIS16470_IMU device to read the current headings from.
    private double
    Offset for the ADIS16470 yaw reading.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct the ADIS16470 imu and reset default configurations.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear sticky faults on IMU.
    void
    Reset IMU to factory default.
    Get the instantiated IMU object.
    void
    getYawPitchRoll(double[] yprArray)
    Fetch the yaw/pitch/roll from the IMU.
    void
    setYaw(double yaw)
    Set the yaw in degrees.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • imu

      private final edu.wpi.first.wpilibj.ADIS16470_IMU imu
      ADIS16470_IMU device to read the current headings from.
    • yawOffset

      private double yawOffset
      Offset for the ADIS16470 yaw reading.
  • Constructor Details

    • ADIS16470Swerve

      public ADIS16470Swerve()
      Construct the ADIS16470 imu and reset default configurations. Publish the gyro to the SmartDashboard.
  • Method Details

    • factoryDefault

      public void factoryDefault()
      Reset IMU to factory default.
      Specified by:
      factoryDefault in class SwerveIMU
    • clearStickyFaults

      public void clearStickyFaults()
      Clear sticky faults on IMU.
      Specified by:
      clearStickyFaults in class SwerveIMU
    • setYaw

      public void setYaw(double yaw)
      Set the yaw in degrees.
      Specified by:
      setYaw in class SwerveIMU
      Parameters:
      yaw - Yaw angle in degrees.
    • getYawPitchRoll

      public void getYawPitchRoll(double[] yprArray)
      Fetch the yaw/pitch/roll from the IMU.
      Specified by:
      getYawPitchRoll in class SwerveIMU
      Parameters:
      yprArray - Array which will be filled with {yaw, pitch, roll} in degrees.
    • getIMU

      public Object getIMU()
      Get the instantiated IMU object.
      Specified by:
      getIMU in class SwerveIMU
      Returns:
      IMU object.