Class SwerveModuleIOSim

java.lang.Object
com.marslib.swerve.SwerveModuleIOSim
All Implemented Interfaces:
SwerveModuleIO

public class SwerveModuleIOSim extends Object implements SwerveModuleIO
Simulation IO layer for a single swerve module.

Both the drive and turn motor physics are handled by the maple-sim SwerveModuleSimulation.

  • Constructor Details

    • SwerveModuleIOSim

      public SwerveModuleIOSim(int moduleIndex)
  • Method Details

    • setModuleSimulation

      public void setModuleSimulation(org.ironmaple.simulation.drivesims.SwerveModuleSimulation sim)
    • updateInputs

      public void updateInputs(SwerveModuleIO.SwerveModuleIOInputs inputs)
      Description copied from interface: SwerveModuleIO
      Updates the set of loggable inputs.
      Specified by:
      updateInputs in interface SwerveModuleIO
    • setDriveVoltage

      public void setDriveVoltage(double volts)
      Description copied from interface: SwerveModuleIO
      Run the drive motor at the specified voltage.
      Specified by:
      setDriveVoltage in interface SwerveModuleIO
    • setTurnVoltage

      public void setTurnVoltage(double volts)
      Description copied from interface: SwerveModuleIO
      Run the turn motor at the specified voltage.
      Specified by:
      setTurnVoltage in interface SwerveModuleIO
    • getSimDriveVoltage

      public double getSimDriveVoltage()
    • getSimTurnVoltage

      public double getSimTurnVoltage()