Class SwerveModule


  • public class SwerveModule
    extends java.lang.Object
    Represents a single swerve module with both drive and azimuth control.
    • Constructor Detail

      • SwerveModule

        public SwerveModule​(SwerveGains gains,
                            edu.wpi.first.wpilibj.motorcontrol.MotorController driveMotor,
                            edu.wpi.first.wpilibj.motorcontrol.MotorController angleMotor,
                            java.util.function.Supplier<edu.wpi.first.math.geometry.Rotation2d> moduleAngle,
                            java.util.function.DoubleSupplier driveMotorVelocity,
                            PIDFController driveController,
                            PIDFController angleController)
    • Method Detail

      • getModuleAngle

        public edu.wpi.first.math.geometry.Rotation2d getModuleAngle()
      • getVelocity

        public double getVelocity()
      • getDriveMotor

        public edu.wpi.first.wpilibj.motorcontrol.MotorController getDriveMotor()
      • getAzimuthMotor

        public edu.wpi.first.wpilibj.motorcontrol.MotorController getAzimuthMotor()
      • setRawAzimuthPower

        public void setRawAzimuthPower​(double pwr)
      • setRawDrivePower

        public void setRawDrivePower​(double pwr)