Class IntakeShoulder

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.intake.IntakeShoulder
All Implemented Interfaces:
Sendable, Subsystem

public class IntakeShoulder extends SubsystemBase
  • Constructor Details

    • IntakeShoulder

      public IntakeShoulder()
      Constructor for motor which raises and lowers intakes with associated configurations, sets up Motion Magic, and configures gear ratios.
  • Method Details

    • limitSwitchPeriodic

      public void limitSwitchPeriodic()
      Periodic function that updates the intake limit switch.
    • getPosition

      public double getPosition()
      Gets the current position of the motor. Mostly exists for logging.
      Returns:
      The current position of the intake motor.
    • raiseIntakeSlowCommand

      public Command raiseIntakeSlowCommand()
      Command which raises shoulder of intake slowly
      Returns:
      runOnce(() -> raiseIntakeSlow());
    • lowerIntakeCommand

      public Command lowerIntakeCommand()
      Command which lowers shoulder of intake
      Returns:
      runOnce(() - > lowerIntake());
    • agitateCommand

      public Command agitateCommand()
      Command which continously runs agitate method when triggered and raises intake when cancelled.
      Returns:
      run(() -> agitate()).finallyDo(() -> raiseIntake());
    • lowerToDepotCommand

      public Command lowerToDepotCommand()
      Command which calls lowerToDepot method.
      Returns:
      runOnce(() -> lowerToDepot());
    • stowOverBumperCommand

      public Command stowOverBumperCommand()
      Command which calls stowOverBumper method.
      Returns:
      runOnce(() -> stowOverBumper());
    • zeroEncoder

      public void zeroEncoder()
    • getIsAtTarget

      public boolean getIsAtTarget()
      Method which checks angle of motor using Phoenix and WPILib commands.
      Returns:
      boolean indicating if motor position is within tolerance to angle
    • nudgeIntakeCommand

      public Command nudgeIntakeCommand(Supplier<Double> nudgeAmount)
      Nudges the intake setpoint by a certain amount.
      Parameters:
      nudgeAmount - The amount to nudge by.
      Returns:
      Command to run.
    • getHasReachedTarget

      public boolean getHasReachedTarget(double distance, double tolerance)
    • disableBrakeMode

      public void disableBrakeMode()
      Disables brake mode.
    • enableBrakeMode

      public void enableBrakeMode()
      Enables brake mode.
    • disableBrakeModeCommand

      public Command disableBrakeModeCommand()
      Disables brake mode.

      This command can be run while disabled.

      Returns:
      Command to run.
    • enableBrakeModeCommand

      public Command enableBrakeModeCommand()
      Enables brake mode.

      This command can be run while disabled.

      Returns:
      Command to run.
      Implementation Note:
      Called internally on enable to reset things.