Package com.marslib.swerve
Class SwerveModuleIOSim
java.lang.Object
com.marslib.swerve.SwerveModuleIOSim
- All Implemented Interfaces:
SwerveModuleIO
Simulation IO layer for a single swerve module.
Both the drive and turn motor physics are handled by the maple-sim SwerveModuleSimulation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.marslib.swerve.SwerveModuleIO
SwerveModuleIO.SwerveModuleIOInputs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledoublevoidsetDriveVoltage(double volts) Run the drive motor at the specified voltage.voidsetModuleSimulation(org.ironmaple.simulation.drivesims.SwerveModuleSimulation sim) voidsetTurnVoltage(double volts) Run the turn motor at the specified voltage.voidUpdates the set of loggable inputs.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.marslib.swerve.SwerveModuleIO
setDriveBrakeMode, setTurnBrakeMode
-
Constructor Details
-
SwerveModuleIOSim
public SwerveModuleIOSim(int moduleIndex)
-
-
Method Details
-
setModuleSimulation
public void setModuleSimulation(org.ironmaple.simulation.drivesims.SwerveModuleSimulation sim) -
updateInputs
Description copied from interface:SwerveModuleIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceSwerveModuleIO
-
setDriveVoltage
public void setDriveVoltage(double volts) Description copied from interface:SwerveModuleIORun the drive motor at the specified voltage.- Specified by:
setDriveVoltagein interfaceSwerveModuleIO
-
setTurnVoltage
public void setTurnVoltage(double volts) Description copied from interface:SwerveModuleIORun the turn motor at the specified voltage.- Specified by:
setTurnVoltagein interfaceSwerveModuleIO
-
getSimDriveVoltage
public double getSimDriveVoltage() -
getSimTurnVoltage
public double getSimTurnVoltage()
-