Package frc.robot
Class CommandFactory
java.lang.Object
frc.robot.CommandFactory
Factory for Composed Commands
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandautoScore(Swerve swerve, Elevator elevator, CoralScoring coralScoring, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height, Supplier<Optional<ScoringLocation.Height>> additionalAlgaeHeight, Consumer<ScoringLocation.Height> crossOut) Move and score coral or retrieve algae.static CommandbackAwayReef(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location) Safely move far away enough to go home.static CommandbargeSpitAlgae(Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist) Command to Raise Elevator and spit algae into the bargestatic CommanddropAlgaeIntake(Swerve swerve) Move slightly to ensure algae intake is dropped.static CommandensureHome(Elevator elevator) Go home, no exceptionstatic CommandfasterFeeder(Swerve swerve, Elevator elevator, CoralScoring coral) Move to faster feederstatic CommandleftFeeder(Swerve swerve, Elevator elevator, CoralScoring coral) Move to left feederstatic CommandleftFeederClose(Swerve swerve, Elevator elevator, CoralScoring coral) Move to left feeder closestatic CommandmaybePickupAlgae(Swerve swerve, Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> algaeHeight, Consumer<ScoringLocation.Height> crossOut) Pick algae off of reefstatic CommandmaybeScoreCoral(Swerve swerve, Elevator elevator, CoralScoring coralScoring, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coral if coral height selectedstatic CommandreefAlign(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location, double distAway) Align to a given scoring location, assuming elevator is at the right height.static CommandreefPreAlign(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location) Approach reef scoring location.static CommandrightFeeder(Swerve swerve, Elevator elevator, CoralScoring coral) Move to right feederstatic CommandrightFeederClose(Swerve swerve, Elevator elevator, CoralScoring coral) Move to left feeder closestatic CommandscoreCoralAutoStart(Swerve swerve, Elevator elevator, CoralScoring coralScoring, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coral if coral height selectedstatic CommandscoreInBarge(Swerve swerve, Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist) move and score in barge finalstatic CommandscoreWithElevator(Swerve swerve, Elevator elevator, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coralstatic CommandselectFeeder(Swerve swerve, Elevator elevator, CoralScoring coral, Supplier<Character> charSupplier) Move to feeder depending on webcontroller code
-
Constructor Details
-
CommandFactory
public CommandFactory()
-
-
Method Details
-
dropAlgaeIntake
Move slightly to ensure algae intake is dropped. -
reefPreAlign
Approach reef scoring location. Elevator can be home during this. -
reefAlign
public static Command reefAlign(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location, double distAway) Align to a given scoring location, assuming elevator is at the right height. -
backAwayReef
Safely move far away enough to go home. -
scoreWithElevator
public static Command scoreWithElevator(Swerve swerve, Elevator elevator, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coral -
ensureHome
Go home, no exception -
maybeScoreCoral
public static Command maybeScoreCoral(Swerve swerve, Elevator elevator, CoralScoring coralScoring, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coral if coral height selected -
scoreCoralAutoStart
public static Command scoreCoralAutoStart(Swerve swerve, Elevator elevator, CoralScoring coralScoring, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coral if coral height selected -
maybePickupAlgae
public static Command maybePickupAlgae(Swerve swerve, Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> algaeHeight, Consumer<ScoringLocation.Height> crossOut) Pick algae off of reef -
autoScore
public static Command autoScore(Swerve swerve, Elevator elevator, CoralScoring coralScoring, ElevatorAlgae algae, AlgaeWrist wrist, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height, Supplier<Optional<ScoringLocation.Height>> additionalAlgaeHeight, Consumer<ScoringLocation.Height> crossOut) Move and score coral or retrieve algae. -
leftFeeder
Move to left feeder -
leftFeederClose
Move to left feeder close -
rightFeeder
Move to right feeder -
rightFeederClose
Move to left feeder close -
fasterFeeder
Move to faster feeder -
selectFeeder
public static Command selectFeeder(Swerve swerve, Elevator elevator, CoralScoring coral, Supplier<Character> charSupplier) Move to feeder depending on webcontroller code -
scoreInBarge
public static Command scoreInBarge(Swerve swerve, Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist) move and score in barge final- Parameters:
swerve- swerveelevator- elevatoralgae- algae- Returns:
- move and score in barge
-
bargeSpitAlgae
Command to Raise Elevator and spit algae into the barge- Parameters:
elevator- Elevator Subsystemalgae- Algae Subsystem- Returns:
- Command
-