Skip to content

Commit

Permalink
Don't interrupt ourselves in auto (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGilb authored Mar 26, 2023
1 parent 8156ac5 commit 9fad931
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/xbot/common/command/BaseMaintainerCommand.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xbot.common.command;

import edu.wpi.first.wpilibj.DriverStation;
import xbot.common.logic.HumanVsMachineDecider;
import xbot.common.logic.HumanVsMachineDecider.HumanVsMachineDeciderFactory;
import xbot.common.logic.HumanVsMachineDecider.HumanVsMachineMode;
Expand Down Expand Up @@ -101,7 +102,7 @@ protected void initializeMachineControlAction() {
// we can't require and then un-require a subsystem, so instead we just cancel
// any running command that
// is trying to maniuplate the setpoint.
if (subsystemToMaintan.getSetpointLock().getCurrentCommand() != null) {
if (subsystemToMaintan.getSetpointLock().getCurrentCommand() != null && !DriverStation.isAutonomous()) {
subsystemToMaintan.getSetpointLock().getCurrentCommand().cancel();
}

Expand Down

0 comments on commit 9fad931

Please sign in to comment.