Interface WristIO
- All Known Implementing Classes:
WristIOTalonFXReal,WristIOTalonFXSim
public interface WristIO
Interface defining the hardware abstraction layer for the wrist subsystem. This interface allows
for different hardware implementations (real, simulated, etc.) while maintaining consistent
functionality.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classData structure for inputs from wrist hardware. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidsetWristOpenLoop(double percentOutput) Runs the wrist using direct percentage output (open-loop control).default voidsetWristPosition(Angle position, int pidSlot) Sets the wrist to run to a target position using closed-loop control.default voidsetWristPositionMotionMagic(Angle position, int pidSlot) Sets the wrist to run at a target position using motion magic control.default voidsetWristVelocity(AngularVelocity velocity, int pidSlot) Sets the wrist to run at a target velocity using closed-loop control.default voidstop()Stops all wrist motor movement.default voidupdateInputs(WristIO.WristIOInputs inputs) Updates the wrist input values from hardware.
-
Method Details
-
updateInputs
Updates the wrist input values from hardware.- Parameters:
inputs- The input object to update with the latest hardware state
-
setWristPosition
Sets the wrist to run to a target position using closed-loop control.- Parameters:
position- The target angle to move topidSlot- The PID slot to use (0 for velocity, 1 for position)
-
setWristVelocity
Sets the wrist to run at a target velocity using closed-loop control.- Parameters:
velocity- The target velocity to move atpidSlot- The PID slot to use (0 for velocity, 1 for position)
-
setWristPositionMotionMagic
Sets the wrist to run at a target position using motion magic control.- Parameters:
position- The target position to move topidSlot- The PID slot to use (0 for velocity, 1 for position)
-
setWristOpenLoop
default void setWristOpenLoop(double percentOutput) Runs the wrist using direct percentage output (open-loop control).- Parameters:
percentOutput- The motor output as a percentage (-1.0 to 1.0)
-
stop
default void stop()Stops all wrist motor movement.
-