Skip to content

Commit

Permalink
Brake mode during auto
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitkakkar committed Mar 23, 2024
1 parent c26c0ac commit 1ca5a60
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public void autonomousInit() {
if (m_autonomousCommand != null) {
m_autonomousCommand.schedule();
}

m_robotContainer.autonomousInit();
}

@Override
Expand All @@ -108,6 +110,8 @@ public void teleopInit() {
if (m_autonomousCommand != null) {
m_autonomousCommand.cancel();
}

m_robotContainer.teleopInit();
}

@Override
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,20 @@ private void autoModeChooser() {
m_automodeChooser.addOption(Constants.AutoNames.RIGHT_FARDISRUPT_FARTOP_AUTO_NAME, new AutoTrajectory(DRIVE_SUBSYSTEM, Constants.AutoNames.RIGHT_FARDISRUPT_FARTOP_AUTO_NAME).getCommand());
}

/**
* Initialization code for autonomous mode.
*/
public void autonomousInit() {
DRIVE_SUBSYSTEM.disableTractionControlCommand();
}

/**
* Initialization code for teleop mode.
*/
public void teleopInit() {
DRIVE_SUBSYSTEM.enableTractionControlCommand();
}

/**
* Run simlation related methods
*/
Expand Down

0 comments on commit 1ca5a60

Please sign in to comment.