Class ModuleIOTalonFXandFXS

java.lang.Object
frc.RebeLib.subsystems.drive.ModuleIOTalonFXandFXS
All Implemented Interfaces:
ModuleIO

public class ModuleIOTalonFXandFXS extends Object implements ModuleIO
Module IO implementation for Talon FX drive motor controller, Talon FX turn motor controller, and CANcoder. Configured using a set of module constants from Phoenix.

Device configuration and other behaviors not exposed by TunerConstants can be customized here.

  • Nested Class Summary

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

    ModuleIO.ModuleIOInputs
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModuleIOTalonFXandFXS(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

    • ModuleIOTalonFXandFXS

      public ModuleIOTalonFXandFXS(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