java.lang.Object
frc.alotobots.library.subsystems.swervedrive.io.ModuleIOSim
All Implemented Interfaces:
ModuleIO

public class ModuleIOSim extends Object implements 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.
  • Constructor Details

    • ModuleIOSim

      public ModuleIOSim(int moduleIndex)
  • Method Details

    • updateInputs

      public void updateInputs(ModuleIO.ModuleIOInputs inputs)
      Description copied from interface: ModuleIO
      Updates the set of loggable inputs.
      Specified by:
      updateInputs in interface ModuleIO
    • setDriveOpenLoop

      public void setDriveOpenLoop(double output)
      Description copied from interface: ModuleIO
      Run the drive motor at the specified open loop value.
      Specified by:
      setDriveOpenLoop in interface ModuleIO
    • setTurnOpenLoop

      public void setTurnOpenLoop(double output)
      Description copied from interface: ModuleIO
      Run the turn motor at the specified open loop value.
      Specified by:
      setTurnOpenLoop in interface ModuleIO
    • setDriveVelocity

      public void setDriveVelocity(double velocityRadPerSec)
      Description copied from interface: ModuleIO
      Run the drive motor at the specified velocity.
      Specified by:
      setDriveVelocity in interface ModuleIO
    • setTurnPosition

      public void setTurnPosition(Rotation2d rotation)
      Description copied from interface: ModuleIO
      Run the turn motor to the specified rotation.
      Specified by:
      setTurnPosition in interface ModuleIO