Interface ModuleIO
- All Known Implementing Classes:
ModuleIOSim,ModuleIOSpark
public interface ModuleIO
Interface for the swerve module input/output abstraction.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classContains all of the inputs received from the module hardware. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidClears all faults and warnings.default voidsetDriveOpenLoop(Voltage output) Run the drive motor at the specified open loop voltage.default voidsetDriveVelocity(AngularVelocity velocity) Run the drive motor at the specified angular velocity.default voidsetTurnOpenLoop(Voltage output) Run the turn motor at the specified open loop voltage.default voidsetTurnPosition(Angle rotation) Run the turn motor to the specified rotation.default voidupdateHighFreq(double timestampSec) Polls high-frequency data for the 200Hz odometry loop.default voidupdateInputs(ModuleIO.ModuleIOInputs inputs) Updates the set of loggable inputs.
-
Method Details
-
updateInputs
Updates the set of loggable inputs.- Parameters:
inputs- The inputs object to update.
-
updateHighFreq
default void updateHighFreq(double timestampSec) Polls high-frequency data for the 200Hz odometry loop.- Parameters:
timestampSec- The exact timestamp of the current 200Hz tick.
-
setDriveOpenLoop
Run the drive motor at the specified open loop voltage.- Parameters:
output- The voltage to apply.
-
setTurnOpenLoop
Run the turn motor at the specified open loop voltage.- Parameters:
output- The voltage to apply.
-
setDriveVelocity
Run the drive motor at the specified angular velocity.- Parameters:
velocity- The target velocity in radians per second.
-
setTurnPosition
Run the turn motor to the specified rotation.- Parameters:
rotation- The target angle as an Angle measure.
-
clearFaults
default void clearFaults()Clears all faults and warnings.
-