Class ModuleIOSim
java.lang.Object
frc.alotobots.library.subsystems.swervedrive.io.ModuleIOSim
- All Implemented Interfaces:
ModuleIO
Physics sim implementation of module IO. The sim models are configured using a set of module
constants from Phoenix. Simulation is always based on voltage control.
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.alotobots.library.subsystems.swervedrive.io.ModuleIO
ModuleIO.ModuleIOInputs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetDriveOpenLoop(double output) Run the drive motor at the specified open loop value.voidsetDriveVelocity(double velocityRadPerSec) Run the drive motor at the specified velocity.voidsetTurnOpenLoop(double output) Run the turn motor at the specified open loop value.voidsetTurnPosition(Rotation2d rotation) Run the turn motor to the specified rotation.voidupdateInputs(ModuleIO.ModuleIOInputs inputs) Updates the set of loggable inputs.
-
Constructor Details
-
ModuleIOSim
public ModuleIOSim(int moduleIndex)
-
-
Method Details
-
updateInputs
Description copied from interface:ModuleIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceModuleIO
-
setDriveOpenLoop
public void setDriveOpenLoop(double output) Description copied from interface:ModuleIORun the drive motor at the specified open loop value.- Specified by:
setDriveOpenLoopin interfaceModuleIO
-
setTurnOpenLoop
public void setTurnOpenLoop(double output) Description copied from interface:ModuleIORun the turn motor at the specified open loop value.- Specified by:
setTurnOpenLoopin interfaceModuleIO
-
setDriveVelocity
public void setDriveVelocity(double velocityRadPerSec) Description copied from interface:ModuleIORun the drive motor at the specified velocity.- Specified by:
setDriveVelocityin interfaceModuleIO
-
setTurnPosition
Description copied from interface:ModuleIORun the turn motor to the specified rotation.- Specified by:
setTurnPositionin interfaceModuleIO
-