Class ModuleIOTalonFXS
java.lang.Object
com.stuypulse.robot.subsystems.swerve.ModuleIOTalonFXS
- All Implemented Interfaces:
ModuleIO
Module IO implementation for Talon FXS drive motor controller, Talon FXS turn motor controller,
and CANdi (PWM 1). 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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.ctre.phoenix6.hardware.CANdiprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Voltage> private final org.wpilib.math.filter.Debouncerprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Current> private final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Angle> private final com.ctre.phoenix6.hardware.TalonFXSprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.AngularVelocity> private final com.ctre.phoenix6.controls.PositionVoltageprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Angle> private final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Voltage> private final org.wpilib.math.filter.Debouncerprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Current> private final org.wpilib.math.filter.Debouncerprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.Angle> private final com.ctre.phoenix6.hardware.TalonFXSprivate final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.AngularVelocity> private final com.ctre.phoenix6.controls.VelocityVoltageprivate final com.ctre.phoenix6.controls.VoltageOut -
Constructor Summary
ConstructorsConstructorDescriptionModuleIOTalonFXS(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXSConfiguration, com.ctre.phoenix6.configs.TalonFXSConfiguration, com.ctre.phoenix6.configs.CANdiConfiguration> 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(org.wpilib.math.geometry.Rotation2d rotation) Run the turn motor to the specified rotation.private static voidtryUntilOk(int maxAttempts, Supplier<com.ctre.phoenix6.StatusCode> command) voidupdateInputs(ModuleIO.ModuleIOInputs inputs) Updates the set of loggable inputs.
-
Field Details
-
driveTalon
-
turnTalon
-
candi
-
voltageRequest
-
positionVoltageRequest
-
velocityVoltageRequest
-
timestampQueue
-
drivePosition
-
drivePositionQueue
-
driveVelocity
private final com.ctre.phoenix6.StatusSignal<org.wpilib.units.measure.AngularVelocity> driveVelocity -
driveAppliedVolts
-
driveCurrent
-
turnAbsolutePosition
-
turnPosition
-
turnPositionQueue
-
turnVelocity
-
turnAppliedVolts
-
turnCurrent
-
driveConnectedDebounce
-
turnConnectedDebounce
-
turnEncoderConnectedDebounce
-
-
Constructor Details
-
ModuleIOTalonFXS
public ModuleIOTalonFXS(com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXSConfiguration, com.ctre.phoenix6.configs.TalonFXSConfiguration, com.ctre.phoenix6.configs.CANdiConfiguration> constants)
-
-
Method Details
-
tryUntilOk
-
updateInputs
Description copied from interface:ModuleIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceModuleIO
-
setDriveOpenLoop
Description copied from interface:ModuleIORun the drive motor at the specified open loop value.- Specified by:
setDriveOpenLoopin interfaceModuleIO
-
setTurnOpenLoop
Description copied from interface:ModuleIORun the turn motor at the specified open loop value.- Specified by:
setTurnOpenLoopin interfaceModuleIO
-
setDriveVelocity
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
-