Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Maybe fix auto stow after scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjcoderman committed Nov 9, 2023
1 parent 2013a17 commit 85728e3
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public SuperstructureManager(
private void setGoal(SuperstructureState goalState) {
this.goalState = goalState;
if (goalState.equals(States.STOWED)) {
scoringHeight = null;
scoringProgress = ScoringProgress.NOT_SCORING;
}
}
Expand Down Expand Up @@ -232,18 +233,18 @@ public Command getScoreFinishCommand(Supplier<NodeHeight> height) {
scoringHeight = height.get();
scoringProgress = ScoringProgress.PLACING;
})
.andThen(setStateCommand(() -> getScoringState(height.get()).aligning))
.andThen(setStateCommand(() -> getScoringState(height.get()).scoring))
.andThen(setStateCommand(() -> getScoringState(scoringHeight).aligning))
.andThen(setStateCommand(() -> getScoringState(scoringHeight).scoring))
.andThen(
Commands.runOnce(
() -> {
scoringHeight = null;
scoringProgress = ScoringProgress.DONE_SCORING;

if (height.get() == NodeHeight.LOW) {
if (scoringHeight == NodeHeight.LOW) {
// Auto stow after scoring low
setGoal(States.STOWED);
}

scoringHeight = null;
scoringProgress = ScoringProgress.DONE_SCORING;
}))
.withName("ScoreFinishCommand");
}
Expand Down

0 comments on commit 85728e3

Please sign in to comment.