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 enum
Enum of possible motors to control -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the current angle of the indexerboolean
isCenter()
Check if center limebreak is seeing somethingboolean
Check if the indexer is at its goalboolean
isUp()
void
moveIndexerToPos
(double angle) Rotate the indexer to a certain positionvoid
periodic()
void
rotateAllWheelsPercent
(double percent) Rotates all wheels with a percent valuevoid
rotateAllWheelsVolts
(double volts) Rotate all indexer motors with a certain voltagevoid
rotateMotorPercent
(IndexerSubsystem.IndexerMotors motor, double percent) Rotate one of the motors with a percent valuevoid
rotateMotorVolts
(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, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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()
-