Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Rename brakingmode to neutralmode
Browse files Browse the repository at this point in the history
  • Loading branch information
aidan-mundy committed Feb 5, 2023
1 parent 410114a commit c264c7e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import edu.wpi.first.wpilibj.RobotBase;

/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what
* you are doing, do not modify this file except to change the parameter class to the startRobot
* call.
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what you are doing, do
* not modify this file except to change the parameter class to the startRobot call.
*/
public final class Main {
private Main() {}

/**
* Main initialization function. Do not perform any initialization here.
*
* <p>If you change your main robot class, change the parameter type.
* <p>
* If you change your main robot class, change the parameter type.
*/
public static void main(String... args) {
RobotBase.startRobot(Robot::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public ToggleBrakingModeCommand(DriveBase driveBase) {

@Override
public void initialize() {
driveBase.toggleBrakingMode();
driveBase.toggleNeutralMode();
}

@Override
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/frc/robot/subsystems/DriveBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public DriveBase(int leftFrontId, int leftBackId, int rightFrontId, int rightBac
rightBackMotor.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor);


setBrakingMode(NeutralMode.Brake);
setNeutralMode(NeutralMode.Brake);

differentialDrive =
new LobstahDifferentialDrive(
Expand All @@ -130,24 +130,26 @@ public DriveBase(int leftFrontId, int leftBackId, int rightFrontId, int rightBac
/**
* Toggles the {@link NeutralMode} between Coast and Brake.
*/
public void toggleBrakingMode() {
public void toggleNeutralMode() {
switch (motorNeutralMode) {
case Brake:
setBrakingMode(NeutralMode.Coast);
setNeutralMode(NeutralMode.Coast);
return;
case Coast:
setNeutralMode(NeutralMode.Brake);
return;
default:
setBrakingMode(NeutralMode.Brake);
setNeutralMode(NeutralMode.Brake);
return;
}
}

/**
* Sets the braking mode to the given {@link NeutralMode}.
* Sets the neutral mode to the given {@link NeutralMode}.
*
* @param mode The {@link NeutralMode} to set the motors to
*/
public void setBrakingMode(NeutralMode mode) {
public void setNeutralMode(NeutralMode mode) {
leftFrontMotor.setNeutralMode(mode);
leftBackMotor.setNeutralMode(mode);
rightFrontMotor.setNeutralMode(mode);
Expand Down

0 comments on commit c264c7e

Please sign in to comment.