Package frc.robot.subsystems.intake
Class IntakeShoulder
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.intake.IntakeShoulder
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for motor which raises and lowers intakes with associated configurations, sets up Motion Magic, and configures gear ratios. -
Method Summary
Modifier and TypeMethodDescriptionCommand which continously runs agitate method when triggered and raises intake when cancelled.voidDisables brake mode.Disables brake mode.voidEnables brake mode.Enables brake mode.booleangetHasReachedTarget(double distance, double tolerance) booleanMethod which checks angle of motor using Phoenix and WPILib commands.doubleGets the current position of the motor.voidPeriodic function that updates the intake limit switch.Command which lowers shoulder of intakeCommand which calls lowerToDepot method.nudgeIntakeCommand(Supplier<Double> nudgeAmount) Nudges the intake setpoint by a certain amount.Command which raises shoulder of intake slowlyCommand which calls stowOverBumper method.voidMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, periodic, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
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
Command which raises shoulder of intake slowly- Returns:
- runOnce(() -> raiseIntakeSlow());
-
lowerIntakeCommand
Command which lowers shoulder of intake- Returns:
- runOnce(() - > lowerIntake());
-
agitateCommand
Command which continously runs agitate method when triggered and raises intake when cancelled.- Returns:
- run(() -> agitate()).finallyDo(() -> raiseIntake());
-
lowerToDepotCommand
Command which calls lowerToDepot method.- Returns:
- runOnce(() -> lowerToDepot());
-
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
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
Disables brake mode.This command can be run while disabled.
- Returns:
- Command to run.
-
enableBrakeModeCommand
Enables brake mode.This command can be run while disabled.
- Returns:
- Command to run.
- Implementation Note:
- Called internally on enable to reset things.
-