Package swervelib.imu
Class NavXSwerve
java.lang.Object
swervelib.imu.SwerveIMU
swervelib.imu.NavXSwerve
Communicates with the NavX as the IMU.
-
Field Summary
Fields -
Constructor Summary
Constructors -
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
-
gyro
private com.kauailabs.navx.frc.AHRS gyroNavX IMU. -
yawOffset
private double yawOffsetOffset for the NavX yaw reading.
-
-
Constructor Details
-
NavXSwerve
public NavXSwerve()Constructor for the NavX swerve.
-
-
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.
-