java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.alotobots.reefscape.subsystems.coralIntake.commands.CoralIntakeEject
All Implemented Interfaces:
Sendable

public class CoralIntakeEject extends Command
Command that runs the intake in reverse (negative output) to eject game pieces out the front. Automatically ends when the game piece is no longer detected by the intake sensor. The speed is clamped to the maximum allowed eject percentage.
  • Constructor Details

    • CoralIntakeEject

      public CoralIntakeEject(CoralIntakeSubsystem coralIntakeSubsystem, DoubleSupplier input)
      Creates a new CoralIntakeEject command.
      Parameters:
      coralIntakeSubsystem - The intake subsystem to control
      input - Supplier for the eject speed (-MAX_OPEN_LOOP_EJECT_PERCENTAGE to 0.0). Input is made negative to push outward through the front of the intake.
  • Method Details

    • execute

      public void execute()
      Runs the eject motors at the supplied speed in reverse, clamped to safe limits. Called repeatedly while the command is scheduled.
      Overrides:
      execute in class Command
    • end

      public void end(boolean interrupted)
      Called when the command ends or is interrupted. Stops the intake motors.
      Overrides:
      end in class Command
      Parameters:
      interrupted - true if the command was interrupted, false if it completed normally
    • isFinished

      public boolean isFinished()
      Determines if the command has finished. Returns true once the game piece is no longer detected.
      Overrides:
      isFinished in class Command
      Returns:
      true if no game piece is detected in the intake