Class ModuleIOTalonFX
java.lang.Object
org.teamvan.robot.mechanisms.drive.ModuleIOTalonFX
- 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 ModuleIO
ModuleIO.ModuleIOInputs -
Constructor Summary
ConstructorsConstructorDescriptionModuleIOTalonFX(SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> constants) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetDriveOpenLoop(double output) Run the drive motor at the specified open loop value.voidsetDriveVelocity(double velocityRadPerSec) Run the drive motor at the specified velocity.voidsetTurnOpenLoop(double output) Run the turn motor at the specified open loop value.voidsetTurnPosition(Rotation2d rotation) Run the turn motor to the specified rotation.voidupdateInputs(ModuleIO.ModuleIOInputs inputs) Updates the set of loggable inputs.
-
Constructor Details
-
ModuleIOTalonFX
public ModuleIOTalonFX(SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> constants)
-
-
Method Details
-
updateInputs
Description copied from interface:ModuleIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceModuleIO
-
setDriveOpenLoop
public void setDriveOpenLoop(double output) Description copied from interface:ModuleIORun the drive motor at the specified open loop value.- Specified by:
setDriveOpenLoopin interfaceModuleIO
-
setTurnOpenLoop
public void setTurnOpenLoop(double output) Description copied from interface:ModuleIORun the turn motor at the specified open loop value.- Specified by:
setTurnOpenLoopin interfaceModuleIO
-
setDriveVelocity
public void setDriveVelocity(double velocityRadPerSec) Description copied from interface:ModuleIORun the drive motor at the specified velocity.- Specified by:
setDriveVelocityin interfaceModuleIO
-
setTurnPosition
Description copied from interface:ModuleIORun the turn motor to the specified rotation.- Specified by:
setTurnPositionin interfaceModuleIO
-