Class ModuleIOTalonFX

java.lang.Object
frc.alotobots.library.subsystems.swervedrive.io.ModuleIOTalonFX
All Implemented Interfaces:
ModuleIO
Direct Known Subclasses:
ModuleIOTalonFXReal, ModuleIOTalonFXSim

public class ModuleIOTalonFX extends Object implements ModuleIO
  • Field Details

    • constants

      protected final com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> constants
    • driveTalon

      protected final com.ctre.phoenix6.hardware.TalonFX driveTalon
    • turnTalon

      protected final com.ctre.phoenix6.hardware.TalonFX turnTalon
    • cancoder

      protected final com.ctre.phoenix6.hardware.CANcoder cancoder
    • voltageRequest

      protected final com.ctre.phoenix6.controls.VoltageOut voltageRequest
    • positionVoltageRequest

      protected final com.ctre.phoenix6.controls.PositionVoltage positionVoltageRequest
    • velocityVoltageRequest

      protected final com.ctre.phoenix6.controls.VelocityVoltage velocityVoltageRequest
    • torqueCurrentRequest

      protected final com.ctre.phoenix6.controls.TorqueCurrentFOC torqueCurrentRequest
    • positionTorqueCurrentRequest

      protected final com.ctre.phoenix6.controls.PositionTorqueCurrentFOC positionTorqueCurrentRequest
    • velocityTorqueCurrentRequest

      protected final com.ctre.phoenix6.controls.VelocityTorqueCurrentFOC velocityTorqueCurrentRequest
    • drivePosition

      protected final com.ctre.phoenix6.StatusSignal<Angle> drivePosition
    • driveVelocity

      protected final com.ctre.phoenix6.StatusSignal<AngularVelocity> driveVelocity
    • driveAppliedVolts

      protected final com.ctre.phoenix6.StatusSignal<Voltage> driveAppliedVolts
    • driveCurrent

      protected final com.ctre.phoenix6.StatusSignal<Current> driveCurrent
    • turnAbsolutePosition

      protected final com.ctre.phoenix6.StatusSignal<Angle> turnAbsolutePosition
    • turnVelocity

      protected final com.ctre.phoenix6.StatusSignal<AngularVelocity> turnVelocity
    • turnAppliedVolts

      protected final com.ctre.phoenix6.StatusSignal<Voltage> turnAppliedVolts
    • turnCurrent

      protected final com.ctre.phoenix6.StatusSignal<Current> turnCurrent
  • Constructor Details

    • ModuleIOTalonFX

      protected ModuleIOTalonFX(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> 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(Rotation2d rotation)
      Description copied from interface: ModuleIO
      Run the turn motor to the specified rotation.
      Specified by:
      setTurnPosition in interface ModuleIO