Class ModuleIOTalonFX
java.lang.Object
frc.alotobots.library.subsystems.swervedrive.io.ModuleIOTalonFX
- All Implemented Interfaces:
ModuleIO
- Direct Known Subclasses:
ModuleIOTalonFXReal,ModuleIOTalonFXSim
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.alotobots.library.subsystems.swervedrive.io.ModuleIO
ModuleIO.ModuleIOInputs -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.ctre.phoenix6.hardware.CANcoderprotected final com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> protected final com.ctre.phoenix6.StatusSignal<Voltage>protected final com.ctre.phoenix6.StatusSignal<Current>protected final com.ctre.phoenix6.StatusSignal<Angle>protected final com.ctre.phoenix6.hardware.TalonFXprotected final com.ctre.phoenix6.StatusSignal<AngularVelocity>protected final com.ctre.phoenix6.controls.PositionTorqueCurrentFOCprotected final com.ctre.phoenix6.controls.PositionVoltageprotected final com.ctre.phoenix6.controls.TorqueCurrentFOCprotected final com.ctre.phoenix6.StatusSignal<Angle>protected final com.ctre.phoenix6.StatusSignal<Voltage>protected final com.ctre.phoenix6.StatusSignal<Current>protected final com.ctre.phoenix6.hardware.TalonFXprotected final com.ctre.phoenix6.StatusSignal<AngularVelocity>protected final com.ctre.phoenix6.controls.VelocityTorqueCurrentFOCprotected final com.ctre.phoenix6.controls.VelocityVoltageprotected final com.ctre.phoenix6.controls.VoltageOut -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModuleIOTalonFX(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.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.
-
Field Details
-
constants
protected final com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, constantscom.ctre.phoenix6.configs.CANcoderConfiguration> -
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
-
driveVelocity
-
driveAppliedVolts
-
driveCurrent
-
turnAbsolutePosition
-
turnVelocity
-
turnAppliedVolts
-
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
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
-