Package frc.robot.subsystems
Class IndexerSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.IndexerSubsystem
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class IndexerSubsystem
extends edu.wpi.first.wpilibj2.command.SubsystemBase
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum of possible motors to control -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the current angle of the indexerbooleanisCenter()Check if center limebreak is seeing somethingbooleanCheck if the indexer is at its goalbooleanisUp()voidmoveIndexerToPos(double angle) Rotate the indexer to a certain positionvoidperiodic()voidrotateAllWheelsPercent(double percent) Rotates all wheels with a percent valuevoidrotateAllWheelsVolts(double volts) Rotate all indexer motors with a certain voltagevoidrotateMotorPercent(IndexerSubsystem.IndexerMotors motor, double percent) Rotate one of the motors with a percent valuevoidrotateMotorVolts(IndexerSubsystem.IndexerMotors motor, double volts) rotateMotorVolts rotates one of the motors by setting the voltage applied to the motorMethods 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, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd
-
Constructor Details
-
IndexerSubsystem
public IndexerSubsystem()Indexer subsystem for everything indexer related
-
-
Method Details
-
rotateMotorVolts
rotateMotorVolts rotates one of the motors by setting the voltage applied to the motor- Parameters:
motor- The target motor, can be TOP_WHEEL, BOTTOM_WHEELS, or INDEXER_POSvolts- The target voltage.
-
rotateMotorPercent
Rotate one of the motors with a percent value- Parameters:
motor- The target motor.percent- Percent of motor speed (0.0-1.0)
-
rotateAllWheelsPercent
public void rotateAllWheelsPercent(double percent) Rotates all wheels with a percent value- Parameters:
percent- Percent of motor speed to rotate
-
rotateAllWheelsVolts
public void rotateAllWheelsVolts(double volts) Rotate all indexer motors with a certain voltage- Parameters:
volts- Volts to rotate motor with
-
moveIndexerToPos
public void moveIndexerToPos(double angle) Rotate the indexer to a certain position- Parameters:
angle- The target angle for the indexer
-
isIndexerRotated
public boolean isIndexerRotated()Check if the indexer is at its goal- Returns:
- If the indexer is at its goal
-
isCenter
public boolean isCenter()Check if center limebreak is seeing something- Returns:
- If the limebreak is seeing something
-
isUp
public boolean isUp() -
getIndexerAngle
public double getIndexerAngle()Get the current angle of the indexer- Returns:
- The current angle of the indexer
-
periodic
public void periodic()
-