Interface ModuleIO

All Known Implementing Classes:
ModuleIOSim, ModuleIOSpark

public interface ModuleIO
Interface for the swerve module input/output abstraction.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Contains all of the inputs received from the module hardware.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Clears all faults and warnings.
    default void
    Run the drive motor at the specified open loop voltage.
    default void
    Run the drive motor at the specified angular velocity.
    default void
    Run the turn motor at the specified open loop voltage.
    default void
    Run the turn motor to the specified rotation.
    default void
    updateHighFreq(double timestampSec)
    Polls high-frequency data for the 200Hz odometry loop.
    default void
    Updates the set of loggable inputs.
  • Method Details

    • updateInputs

      default void updateInputs(ModuleIO.ModuleIOInputs inputs)
      Updates the set of loggable inputs.
      Parameters:
      inputs - The inputs object to update.
    • updateHighFreq

      default void updateHighFreq(double timestampSec)
      Polls high-frequency data for the 200Hz odometry loop.
      Parameters:
      timestampSec - The exact timestamp of the current 200Hz tick.
    • setDriveOpenLoop

      default void setDriveOpenLoop(Voltage output)
      Run the drive motor at the specified open loop voltage.
      Parameters:
      output - The voltage to apply.
    • setTurnOpenLoop

      default void setTurnOpenLoop(Voltage output)
      Run the turn motor at the specified open loop voltage.
      Parameters:
      output - The voltage to apply.
    • setDriveVelocity

      default void setDriveVelocity(AngularVelocity velocity)
      Run the drive motor at the specified angular velocity.
      Parameters:
      velocity - The target velocity in radians per second.
    • setTurnPosition

      default void setTurnPosition(Angle rotation)
      Run the turn motor to the specified rotation.
      Parameters:
      rotation - The target angle as an Angle measure.
    • clearFaults

      default void clearFaults()
      Clears all faults and warnings.