Class ModuleIOSim

java.lang.Object
frc.RebeLib.subsystems.drive.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.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface frc.RebeLib.subsystems.drive.ModuleIO

    ModuleIO.ModuleIOInputs
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModuleIOSim(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXSConfiguration,com.ctre.phoenix6.configs.TalonFXSConfiguration> constants)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setDriveOpenLoop(double output)
    Run the drive motor at the specified open loop value.
    void
    setDriveVelocity(double velocityRadPerSec)
    Run the drive motor at the specified velocity.
    void
    setTurnOpenLoop(double output)
    Run the turn motor at the specified open loop value.
    void
    setTurnPosition(edu.wpi.first.math.geometry.Rotation2d rotation)
    Run the turn motor to the specified rotation.
    void
    Updates the set of loggable inputs.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModuleIOSim

      public ModuleIOSim(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXSConfiguration,com.ctre.phoenix6.configs.TalonFXSConfiguration> constants)
  • 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(edu.wpi.first.math.geometry.Rotation2d rotation)
      Description copied from interface: ModuleIO
      Run the turn motor to the specified rotation.
      Specified by:
      setTurnPosition in interface ModuleIO