Class ElevatorIOTalonFXSim
java.lang.Object
frc.alotobots.reefscape.subsystems.elevator.io.ElevatorIOTalonFXSim
- All Implemented Interfaces:
ElevatorIO
Motor Control Types
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.alotobots.reefscape.subsystems.elevator.io.ElevatorIO
ElevatorIO.ElevatorIOInputs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidresetRotorPositions(Distance height) Resets the rotor sensors of both motors to be equal to the given heightvoidsetElevatorBrakeMode(boolean brake) Sets the brake mode for the elevator motors.voidsetElevatorOpenLoop(double percentOutput) Sets the elevator motors to run in open-loop mode at the specified output percentage.voidsetElevatorPosition(Distance position, int pidSlot) Sets the elevator to a specific position using closed-loop control.voidsetElevatorPositionMotionMagic(Distance position, int pidSlot) Sets the elevator to a specific position using closed-loop control.voidsetElevatorVelocity(LinearVelocity velocity, int pidSlot) Sets the elevator to a specific velocity using closed-loop control.voidstop()Stops all elevator motor movement.voidUpdates the input values from the elevator hardware.
-
Constructor Details
-
ElevatorIOTalonFXSim
public ElevatorIOTalonFXSim()
-
-
Method Details
-
updateInputs
Description copied from interface:ElevatorIOUpdates the input values from the elevator hardware. Called periodically to refresh sensor and motor data.- Specified by:
updateInputsin interfaceElevatorIO- Parameters:
inputs- The inputs object to update with the latest values
-
setElevatorPosition
Sets the elevator to a specific position using closed-loop control.- Specified by:
setElevatorPositionin interfaceElevatorIO- Parameters:
position- The target position as a Distance unitpidSlot- The PID slot to use (0 for velocity mode, 1 for position mode)
-
setElevatorPositionMotionMagic
Sets the elevator to a specific position using closed-loop control.- Specified by:
setElevatorPositionMotionMagicin interfaceElevatorIO- Parameters:
position- The target position as a Distance unitpidSlot- The PID slot to use (0 for velocity mode, 1 for position mode)
-
setElevatorVelocity
Sets the elevator to a specific velocity using closed-loop control.- Specified by:
setElevatorVelocityin interfaceElevatorIO- Parameters:
velocity- The target velocity as a LinearVelocity unitpidSlot- The PID slot to use (0 for velocity mode, 1 for position mode)
-
setElevatorOpenLoop
public void setElevatorOpenLoop(double percentOutput) Sets the elevator motors to run in open-loop mode at the specified output percentage.- Specified by:
setElevatorOpenLoopin interfaceElevatorIO- Parameters:
percentOutput- The motor output as a percentage (-1.0 to 1.0)
-
setElevatorBrakeMode
public void setElevatorBrakeMode(boolean brake) Sets the brake mode for the elevator motors.- Specified by:
setElevatorBrakeModein interfaceElevatorIO- Parameters:
brake- true to enable brake mode, false for coast mode
-
resetRotorPositions
Resets the rotor sensors of both motors to be equal to the given height- Specified by:
resetRotorPositionsin interfaceElevatorIO- Parameters:
height- The height off the floor the elevator is at
-
stop
public void stop()Stops all elevator motor movement.- Specified by:
stopin interfaceElevatorIO
-