Change to reset everytime storage returns to the default command

This commit is contained in:
Keenan D. Buckley
2020-03-08 14:30:52 -06:00
parent 09af79f102
commit 2a2b594b9c
2 changed files with 3 additions and 2 deletions
@@ -126,7 +126,7 @@ public class RobotContainer {
m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED));
// runs the storage not
//m_robotStorage.setDefaultCommand(new RunCommand(() -> m_robotStorage.runStorage(0), m_robotStorage));
m_robotStorage.setDefaultCommand(new RunCommand(() -> m_robotStorage.runStorage(0), m_robotStorage));
m_robotStorage.setDefaultCommand(new ManageStorage(m_robotStorage, StorageMode.IDLE));
//m_robotLime.setDefaultCommand(new RunCommand(() -> m_robotLime.limeOff(), m_robotLime));
}
@@ -230,7 +230,7 @@ public class RobotContainer {
//Run drum
new JoystickButton(getOperatorJoystick(), XboxController.B_BUTTON)
.whileHeld(new ShootPrepGroup(m_robotShooter, m_robotShooterAim, m_robotShooterHood, m_robotStorage), false)
.whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET))
//.whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET))
.whenReleased(new InstantCommand(() -> m_robotLime.limeOff()));
}
@@ -128,6 +128,7 @@ public class ManageStorage extends CommandBase {
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
m_storageMode = StorageMode.RESET;
}
// Returns true when the command should end.