Skip to content

Commit

Permalink
Patch default command method
Browse files Browse the repository at this point in the history
  • Loading branch information
viggy96 committed Sep 16, 2024
1 parent 669b34d commit 821e0fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/frc/robot/subsystems/StateMachine.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package frc.robot.subsystems;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;

public abstract class StateMachine extends SubsystemBase {
Expand All @@ -11,7 +12,7 @@ public abstract class StateMachine extends SubsystemBase {
*/
public StateMachine(SystemState initialState) {
this.m_currentState = initialState;
setDefaultCommand(new StateCommand(this::getState, this).repeatedly());
super.setDefaultCommand(new StateCommand(this::getState, this).repeatedly());
}

/**
Expand All @@ -30,4 +31,9 @@ void setState(SystemState state) {
public SystemState getState() {
return m_currentState;
}

@Override
public void setDefaultCommand(Command commmand) {
return;
}
}

0 comments on commit 821e0fb

Please sign in to comment.