Package com.marslib.swerve
Class SwerveModuleIOTalonFX
java.lang.Object
com.marslib.swerve.SwerveModuleIOTalonFX
- All Implemented Interfaces:
SwerveModuleIO
Hardware IO implementation for a Swerve Module using CTRE TalonFX motors and a CANcoder.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.marslib.swerve.SwerveModuleIO
SwerveModuleIO.SwerveModuleIOInputs -
Constructor Summary
ConstructorsConstructorDescriptionSwerveModuleIOTalonFX(int driveMotorId, int turnMotorId, String canbus, SwerveConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetDriveBrakeMode(boolean enable) Sets the neutral mode of the drive motor.voidsetDriveVoltage(double volts) Run the drive motor at the specified voltage.voidsetTurnBrakeMode(boolean enable) Sets the neutral mode of the turn motor.voidsetTurnVoltage(double volts) Run the turn motor at the specified voltage.voidUpdates the set of loggable inputs.
-
Constructor Details
-
SwerveModuleIOTalonFX
-
-
Method Details
-
updateInputs
Description copied from interface:SwerveModuleIOUpdates the set of loggable inputs.- Specified by:
updateInputsin interfaceSwerveModuleIO
-
setDriveVoltage
public void setDriveVoltage(double volts) Description copied from interface:SwerveModuleIORun the drive motor at the specified voltage.- Specified by:
setDriveVoltagein interfaceSwerveModuleIO
-
setTurnVoltage
public void setTurnVoltage(double volts) Description copied from interface:SwerveModuleIORun the turn motor at the specified voltage.- Specified by:
setTurnVoltagein interfaceSwerveModuleIO
-
setDriveBrakeMode
public void setDriveBrakeMode(boolean enable) Description copied from interface:SwerveModuleIOSets the neutral mode of the drive motor.- Specified by:
setDriveBrakeModein interfaceSwerveModuleIO
-
setTurnBrakeMode
public void setTurnBrakeMode(boolean enable) Description copied from interface:SwerveModuleIOSets the neutral mode of the turn motor.- Specified by:
setTurnBrakeModein interfaceSwerveModuleIO
-