Package frc.RebeLib.subsystems.drive
Class ModuleIOTalonFXandFXS
java.lang.Object
frc.RebeLib.subsystems.drive.ModuleIOTalonFXandFXS
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionModuleIOTalonFXandFXS
(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 TypeMethodDescriptionvoid
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
updateInputs
(ModuleIO.ModuleIOInputs inputs) Updates the set of loggable inputs.
-
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
Description copied from interface:ModuleIO
Updates the set of loggable inputs.- Specified by:
updateInputs
in interfaceModuleIO
-
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 interfaceModuleIO
-
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 interfaceModuleIO
-
setDriveVelocity
public void setDriveVelocity(double velocityRadPerSec) Description copied from interface:ModuleIO
Run the drive motor at the specified velocity.- Specified by:
setDriveVelocity
in interfaceModuleIO
-
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 interfaceModuleIO
-