Class CoralIntakeEjectThrough
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.alotobots.reefscape.subsystems.coralIntake.commands.CoralIntakeEjectThrough
- All Implemented Interfaces:
Sendable
Command that runs the intake to eject game pieces by pulling them through in the intake direction
(positive output). This runs the motors in the same direction as intake to push pieces out
through the intake side of the robot. Automatically ends when the game piece is no longer
detected by the intake sensor.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionCoralIntakeEjectThrough
(CoralIntakeSubsystem coralIntakeSubsystem, DoubleSupplier input) Creates a new CoralIntakeEjectThrough command. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initialize, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
CoralIntakeEjectThrough
Creates a new CoralIntakeEjectThrough command.- Parameters:
coralIntakeSubsystem
- The intake subsystem to controlinput
- Supplier for the eject speed (0.0 to MAX_OPEN_LOOP_EJECT_PERCENTAGE). Positive values pull through in the intake direction.
-
-
Method Details
-
execute
public void execute()Runs the motors at the supplied speed in the intake direction, clamped to safe limits. Called repeatedly while the command is scheduled. -
end
public void end(boolean interrupted) Called when the command ends or is interrupted. Stops the intake motors. -
isFinished
public boolean isFinished()Determines if the command has finished. Returns true once the game piece is no longer detected.- Overrides:
isFinished
in classCommand
- Returns:
- true if no game piece is detected in the intake
-