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.CANcoder
protected 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.TalonFX
protected final com.ctre.phoenix6.StatusSignal<AngularVelocity>
protected final com.ctre.phoenix6.controls.PositionTorqueCurrentFOC
protected final com.ctre.phoenix6.controls.PositionVoltage
protected final com.ctre.phoenix6.controls.TorqueCurrentFOC
protected 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.TalonFX
protected final com.ctre.phoenix6.StatusSignal<AngularVelocity>
protected final com.ctre.phoenix6.controls.VelocityTorqueCurrentFOC
protected final com.ctre.phoenix6.controls.VelocityVoltage
protected final com.ctre.phoenix6.controls.VoltageOut
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ModuleIOTalonFX
(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 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
(Rotation2d rotation) Run the turn motor to the specified rotation.void
updateInputs
(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: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
Description copied from interface:ModuleIO
Run the turn motor to the specified rotation.- Specified by:
setTurnPosition
in interfaceModuleIO
-