Skip to content

Commit

Permalink
Trap repeatedly (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner authored Mar 9, 2024
1 parent a889655 commit f316d57
Showing 1 changed file with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,24 +208,31 @@ public static Command climbNTrapSequence(
Commands.waitUntil(trapScoreTrigger)
.andThen(Commands.waitUntil(trapScoreTrigger.negate()))),

// Extend backpack
superstructure
.setGoalCommand(Superstructure.Goal.TRAP)
.alongWith(rollers.setGoalCommand(Rollers.Goal.TRAP_PRESCORE))
.raceWith(
Commands.waitUntil(trapScoreTrigger)
.andThen(Commands.waitUntil(trapScoreTrigger.negate()))),

// Score in trap and wait
rollers
.setGoalCommand(Rollers.Goal.TRAP_SCORE)
.alongWith(superstructure.setGoalCommand(Superstructure.Goal.TRAP))
.raceWith(
Commands.waitUntil(trapScoreTrigger)
.andThen(Commands.waitUntil(trapScoreTrigger.negate()))),

// Retract backpack
superstructure.setGoalCommand(Superstructure.Goal.CLIMB))
// Repeat trap sequence forever and ever
Commands.sequence(
// Extend backpack
superstructure
.setGoalCommand(Superstructure.Goal.TRAP)
.alongWith(rollers.setGoalCommand(Rollers.Goal.TRAP_PRESCORE))
.raceWith(
Commands.waitUntil(trapScoreTrigger)
.andThen(Commands.waitUntil(trapScoreTrigger.negate()))),

// Score in trap and wait
rollers
.setGoalCommand(Rollers.Goal.TRAP_SCORE)
.alongWith(superstructure.setGoalCommand(Superstructure.Goal.TRAP))
.raceWith(
Commands.waitUntil(trapScoreTrigger)
.andThen(Commands.waitUntil(trapScoreTrigger.negate()))),

// Retract backpack
superstructure
.setGoalCommand(Superstructure.Goal.CLIMB)
.raceWith(
Commands.waitUntil(trapScoreTrigger)
.andThen(Commands.waitUntil(trapScoreTrigger.negate()))))
.repeatedly())

// If cancelled, go to safe state
.finallyDo(
Expand Down

0 comments on commit f316d57

Please sign in to comment.