Package frc.robot.subsystems
Class Elevator
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Elevator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA command that does nothing.void
double
void
periodic()
This method is responsible for they safety of the elevator and wrist.SetPositionCommand
(Constants.ArmPosition position) A command to set the elevator and wrist to a position.setSpeedsCommand
(DoubleSupplier elevatorSpeed, DoubleSupplier wristSpeed) A command to set the speeds of the elevator and wrist.Methods 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, startRun
-
Constructor Details
-
Elevator
Creates a new Elevator.
-
-
Method Details
-
periodic
public void periodic()This method is responsible for they safety of the elevator and wrist.This uses the
elevatorTarget
andwristTarget
to determine the target position of the elevator and wrist. If the elevator and wrist are both below their SAFE_MIN_POSITION they will collide. Whenever either one is below their SAFE_MIN_POSITION the other will be limited to the SAFE_MIN_POSITION. -
setSpeedsCommand
A command to set the speeds of the elevator and wrist.- Parameters:
elevatorSpeed
- The speed of the elevator as a percentage of max speed. [-1, 1]wristSpeed
- The speed of the wrist as a percentage of max speed. [-1, 1]- Returns:
Command
to run.
-
SetPositionCommand
A command to set the elevator and wrist to a position.- Parameters:
position
- The Constants.ArmPosition to set the elevator and wrist to.- Returns:
Command
to run.
-
doNothing
A command that does nothing. This command requires the elevator subsystem so it will kill any other command. This is used to let the drivers regain controll of the elevator if it is unable to reach its target.- Returns:
- Command to run.
-
getElevatorTarget
public double getElevatorTarget() -
elevatorInit
public void elevatorInit()
-