Class ElevatorIOTalonFXReal
java.lang.Object
frc.alotobots.reefscape.subsystems.elevator.io.ElevatorIOTalonFXReal
- All Implemented Interfaces:
- ElevatorIO
Hardware implementation of the Elevator subsystem using TalonFX motors and a CANRange sensor.
 This class manages two TalonFX motors (left and right) and a CANRange for position feedback. The
 right motor follows the left motor in an inverted configuration to ensure synchronized movement.
 The CANRange provides absolute position feedback for the elevator mechanism.
- 
Nested Class SummaryNested classes/interfaces inherited from interface frc.alotobots.reefscape.subsystems.elevator.io.ElevatorIOElevatorIO.ElevatorIOInputs
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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 for the elevator subsystem.
- 
Constructor Details- 
ElevatorIOTalonFXRealpublic ElevatorIOTalonFXReal()Constructs a new ElevatorIOTalonFXReal instance. Initializes and configures the TalonFX motors and CANRange sensor with appropriate settings for position control, current limits, and safety features. The right motor is configured to follow the left motor in an inverted configuration.
 
- 
- 
Method Details- 
updateInputsUpdates the input values for the elevator subsystem. Refreshes all status signals and updates the provided inputs object with current sensor readings and state information.- Specified by:
- updateInputsin interface- ElevatorIO
- Parameters:
- inputs- The ElevatorIOInputs object to update with current values
 
- 
setElevatorPositionSets the elevator to a specific position using closed-loop control.- Specified by:
- setElevatorPositionin interface- ElevatorIO
- Parameters:
- position- The target position as a Distance unit
- pidSlot- The PID slot to use (0 for velocity mode, 1 for position mode)
 
- 
setElevatorPositionMotionMagicSets the elevator to a specific position using closed-loop control.- Specified by:
- setElevatorPositionMotionMagicin interface- ElevatorIO
- Parameters:
- position- The target position as a Distance unit
- pidSlot- The PID slot to use (0 for velocity mode, 1 for position mode)
 
- 
setElevatorVelocitySets the elevator to a specific velocity using closed-loop control.- Specified by:
- setElevatorVelocityin interface- ElevatorIO
- Parameters:
- velocity- The target velocity as a LinearVelocity unit
- pidSlot- The PID slot to use (0 for velocity mode, 1 for position mode)
 
- 
setElevatorOpenLooppublic void setElevatorOpenLoop(double percentOutput) Sets the elevator motors to run in open-loop mode at the specified output percentage.- Specified by:
- setElevatorOpenLoopin interface- ElevatorIO
- Parameters:
- percentOutput- The motor output as a percentage (-1.0 to 1.0)
 
- 
setElevatorBrakeModepublic void setElevatorBrakeMode(boolean brake) Sets the brake mode for the elevator motors.- Specified by:
- setElevatorBrakeModein interface- ElevatorIO
- Parameters:
- brake- true to enable brake mode, false for coast mode
 
- 
resetRotorPositionsResets the rotor sensors of both motors to be equal to the given height- Specified by:
- resetRotorPositionsin interface- ElevatorIO
- Parameters:
- height- The height off the floor the elevator is at
 
- 
stoppublic void stop()Stops all elevator motor movement.- Specified by:
- stopin interface- ElevatorIO
 
 
-