Package swervelib.imu
Class AnalogGyroSwerve
java.lang.Object
swervelib.imu.SwerveIMU
swervelib.imu.AnalogGyroSwerve
Creates a IMU for
AnalogGyro devices, only uses yaw.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAnalogGyroSwerve(int channel) Analog port in which the gyroscope is connected. -
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 final edu.wpi.first.wpilibj.AnalogGyro gyroGyroscope object. -
yawOffset
private double yawOffsetThe yaw offset for the gyroscope.
-
-
Constructor Details
-
AnalogGyroSwerve
public AnalogGyroSwerve(int channel) Analog port in which the gyroscope is connected. Can only be attached to analog ports 0 or 1.- Parameters:
channel- Analog port 0 or 1.
-
-
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.
-