Interface ElevatorIO
- All Known Implementing Classes:
ElevatorIOTalonFXReal
,ElevatorIOTalonFXSim
public interface ElevatorIO
Interface for elevator input/output operations. Handles the communication between the elevator
subsystem and its hardware implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Class containing all input values from elevator sensors and motors. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
resetRotorPositions
(Distance height) Resets both motors' (left and right) dead-reckoning position to the rotor count consistent with the input heightdefault void
setElevatorBrakeMode
(boolean brake) Sets whether the elevator motors should brake when idle.default void
setElevatorOpenLoop
(double percentOutput) Sets the elevator motors to run in open-loop control mode.default void
setElevatorPosition
(Distance position, int pidSlot) Sets the target position for the elevator using closed-loop control.default void
setElevatorPositionMotionMagic
(Distance position, int pidSlot) Sets the target position for the elevator using closed-loop control and motion magic.default void
setElevatorVelocity
(LinearVelocity velocity, int pidSlot) Sets the target velocity for the elevator using closed-loop control.default void
stop()
Stops all motorsdefault void
Updates the input values from the elevator hardware.
-
Method Details
-
updateInputs
Updates the input values from the elevator hardware. Called periodically to refresh sensor and motor data.- Parameters:
inputs
- The inputs object to update with the latest values
-
setElevatorPosition
Sets the target position for the elevator using closed-loop control.- Parameters:
position
- The desired position for the elevator
-
setElevatorPositionMotionMagic
Sets the target position for the elevator using closed-loop control and motion magic.- Parameters:
position
- The desired position for the elevator
-
setElevatorVelocity
Sets the target velocity for the elevator using closed-loop control.- Parameters:
velocity
- The desired velocity for the elevator
-
setElevatorOpenLoop
default void setElevatorOpenLoop(double percentOutput) Sets the elevator motors to run in open-loop control mode.- Parameters:
percentOutput
- The desired motor output as a percentage (-1.0 to 1.0)
-
setElevatorBrakeMode
default void setElevatorBrakeMode(boolean brake) Sets whether the elevator motors should brake when idle. Useful during disabled/init to prevent gravity drift.- Parameters:
brake
- true to enable brake mode, false for coast mode
-
resetRotorPositions
Resets both motors' (left and right) dead-reckoning position to the rotor count consistent with the input height- Parameters:
height
- The height that the elevator should reference as zero
-
stop
default void stop()Stops all motors
-