SwerveDrive class done

This commit is contained in:
aarav18
2023-01-14 11:42:03 -07:00
parent eab188b520
commit dc899d42bc
3 changed files with 123 additions and 17 deletions
@@ -26,7 +26,6 @@ public class SwerveModule extends SubsystemBase {
public static Gains swerveGains = SwerveDriveConstants.PIDConstants.SWERVE_GAINS;
/** Creates a new SwerveModule. */
public SwerveModule(WPI_TalonFX driveMotor, WPI_TalonFX angleMotor, CANCoder canCoder, double offset) {
this.driveMotor = driveMotor;
@@ -49,6 +48,30 @@ public class SwerveModule extends SubsystemBase {
canCoder.configAllSettings(canCoderConfig);
}
/**
* Get the drive motor of the SwerveModule
* @return the drive motor of the SwerveModule
*/
public WPI_TalonFX getDriveMotor() {
return this.driveMotor;
}
/**
* Get the angle motor of the SwerveModule
* @return the angle motor of the SwerveModule
*/
public WPI_TalonFX getAngleMotor() {
return this.angleMotor;
}
/**
* Get the CANcoder of the SwerveModule
* @return the CANcoder of the SwerveModule
*/
public CANCoder getEncoder() {
return this.canCoder;
}
/**
* Get the angle of a SwerveModule as a Rotation2d
* @return the angle of a SwerveModule as a Rotation2d