Package frc.robot
Class CommandFactory
java.lang.Object
frc.robot.CommandFactory
Factory for Composed Commands
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static Command
backAwayReef
(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location) Safely move far away enough to go home.static Command
bargeSpitAlgae
(Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist) Command to Raise Elevator and spit algae into the bargestatic Command
dropAlgaeIntake
(Swerve swerve) Move slightly to ensure algae intake is dropped.static Command
ensureHome
(Elevator elevator) Go home, no exceptionstatic Command
fasterFeeder
(Swerve swerve, Elevator elevator, CoralScoring coral) Move to faster feederstatic Command
leftFeeder
(Swerve swerve, Elevator elevator, CoralScoring coral) Move to left feederstatic Command
leftFeederClose
(Swerve swerve, Elevator elevator, CoralScoring coral) Move to left feeder closestatic 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 reefstatic 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 selectedstatic Command
reefAlign
(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location, double distAway) Align to a given scoring location, assuming elevator is at the right height.static Command
reefPreAlign
(Swerve swerve, Supplier<ScoringLocation.CoralLocation> location) Approach reef scoring location.static Command
rightFeeder
(Swerve swerve, Elevator elevator, CoralScoring coral) Move to right feederstatic Command
rightFeederClose
(Swerve swerve, Elevator elevator, CoralScoring coral) Move to left feeder closestatic Command
scoreInBarge
(Swerve swerve, Elevator elevator, ElevatorAlgae algae, AlgaeWrist wrist) move and score in barge finalstatic Command
scoreWithElevator
(Swerve swerve, Elevator elevator, Supplier<ScoringLocation.CoralLocation> location, Supplier<ScoringLocation.Height> height) Score coralstatic Command
selectFeeder
(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 -
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
-