Skip to content

Commit

Permalink
last bit of drive cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Mar 16, 2024
1 parent 027a819 commit 6f6bb2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/main/java/frc/robot/subsystems/drive/DriveBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@ public class DriveBase extends SubsystemBase {

private static final SwerveDriveKinematics m_kinematics;

private final GyroIO m_gyroIO;
private final GyroIOInputsAutoLogged m_gyroInputs = new GyroIOInputsAutoLogged();
private final Module[] m_modules = new Module[4]; // FL, FR, BL, BR
private final OdometryTimestampInputsAutoLogged m_odometryTimestampInputs =
new OdometryTimestampInputsAutoLogged();

private Rotation2d m_lastGyroRotation = new Rotation2d();

private final SwerveModulePosition[] m_lastModulePositions =
new SwerveModulePosition[] {
new SwerveModulePosition(),
new SwerveModulePosition(),
new SwerveModulePosition(),
new SwerveModulePosition()
};

static {
switch (Constants.getRobotType()) {
case ROBOT_SIMBOT, ROBOT_2024_COMP -> {
Expand All @@ -75,6 +59,22 @@ public class DriveBase extends SubsystemBase {
new SwerveDriveKinematics(getModuleTranslations(kTrackWidthXMeters, kTrackWidthYMeters));
}

private final GyroIO m_gyroIO;
private final GyroIOInputsAutoLogged m_gyroInputs = new GyroIOInputsAutoLogged();
private final Module[] m_modules = new Module[4]; // FL, FR, BL, BR
private final OdometryTimestampInputsAutoLogged m_odometryTimestampInputs =
new OdometryTimestampInputsAutoLogged();

private Rotation2d m_lastGyroRotation = new Rotation2d();

private final SwerveModulePosition[] m_lastModulePositions =
new SwerveModulePosition[] {
new SwerveModulePosition(),
new SwerveModulePosition(),
new SwerveModulePosition(),
new SwerveModulePosition()
};

public DriveBase(
GyroIO gyroIO,
ModuleIO frontLeftIO,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/subsystems/drive/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class Module {
public Module(int index, ModuleIO io) {
moduleIndex = index;
m_io = io;

setBrakeMode(true);
}

public void periodic() {
Expand Down

0 comments on commit 6f6bb2a

Please sign in to comment.