Package org.penguinempire.subsystems
Class ElevatorSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
org.penguinempire.subsystems.ElevatorSubsystem
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class ElevatorSubsystem
extends edu.wpi.first.wpilibj2.command.SubsystemBase
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublebooleanhasReachedTarget(double tolerance) voidmoveElevator(boolean up) Moves the elevator up or down.voidperiodic()voidsetPosition(double position) voidStop the elevator immediately (open-loop = 0).Methods 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, startRun
-
Constructor Details
-
ElevatorSubsystem
public ElevatorSubsystem()
-
-
Method Details
-
moveElevator
public void moveElevator(boolean up) Moves the elevator up or down. This is open-loop: up uses "Elevator Speed", down uses "Elevator Down Speed". Since left motor is configured to follow the right motor, we set the right motor. The left motor will automatically match it. -
stopElevator
public void stopElevator()Stop the elevator immediately (open-loop = 0). -
setPosition
public void setPosition(double position) -
getElevatorPosition
public double getElevatorPosition() -
hasReachedTarget
public boolean hasReachedTarget(double tolerance) -
periodic
public void periodic()
-