Package swervelib.imu
Class ADXRS450Swerve
java.lang.Object
swervelib.imu.SwerveIMU
swervelib.imu.ADXRS450Swerve
IMU Swerve class for the
ADXRS450_Gyro device.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct the ADXRS450 imu and reset default configurations. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear sticky faults on IMU.voidReset IMU to factory default.getIMU()Get the instantiated IMU object.voidgetYawPitchRoll(double[] yprArray) Fetch the yaw/pitch/roll from the IMU.voidsetYaw(double yaw) Set the yaw in degrees.
-
Field Details
-
imu
private final edu.wpi.first.wpilibj.ADXRS450_Gyro imuADXRS450_Gyrodevice to read the current headings from. -
yawOffset
private double yawOffsetOffset for the ADXRS450 yaw reading.
-
-
Constructor Details
-
ADXRS450Swerve
public ADXRS450Swerve()Construct the ADXRS450 imu and reset default configurations. Publish the gyro to the SmartDashboard.
-
-
Method Details
-
factoryDefault
public void factoryDefault()Reset IMU to factory default.- Specified by:
factoryDefaultin classSwerveIMU
-
clearStickyFaults
public void clearStickyFaults()Clear sticky faults on IMU.- Specified by:
clearStickyFaultsin classSwerveIMU
-
setYaw
public void setYaw(double yaw) Set the yaw in degrees. -
getYawPitchRoll
public void getYawPitchRoll(double[] yprArray) Fetch the yaw/pitch/roll from the IMU.- Specified by:
getYawPitchRollin classSwerveIMU- Parameters:
yprArray- Array which will be filled with {yaw, pitch, roll} in degrees.
-
getIMU
Get the instantiated IMU object.
-