Class Module
java.lang.Object
com.stuypulse.robot.subsystems.swerve.Module
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> private final org.wpilib.util.Alertprivate final intprivate final com.stuypulse.robot.subsystems.swerve.ModuleIOInputsAutoLoggedprivate final ModuleIOprivate org.wpilib.math.kinematics.SwerveModulePosition[]private final ModuleIO.ModuleIOOutputsprivate final org.wpilib.util.Alertprivate final org.wpilib.util.Alert -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.wpilib.math.geometry.Rotation2dgetAngle()Returns the current turn angle of the module.doubleReturns the module velocity in rotations/sec (Phoenix native units).org.wpilib.math.kinematics.SwerveModulePosition[]Returns the module positions received this cycle.double[]Returns the timestamps of the samples received this cycle.org.wpilib.math.kinematics.SwerveModulePositionReturns the module position (turn angle and drive position).doubleReturns the current drive position of the module in meters.org.wpilib.math.kinematics.SwerveModuleVelocityReturns the module velocity (turn angle and drive velocity).doubleReturns the current drive velocity of the module in meters per second.doubleReturns the module position in radians.voidperiodic()voidvoidrunCharacterization(double output) Runs the module with the specified output while controlling to zero degrees.voidrunSetpoint(org.wpilib.math.kinematics.SwerveModuleVelocity state) Runs the module with the specified setpoint state.voidstop()Disables all outputs to motors.
-
Field Details
-
io
-
inputs
-
outputs
-
index
-
constants
private final com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> constants -
driveDisconnectedAlert
-
turnDisconnectedAlert
-
turnEncoderDisconnectedAlert
-
odometryPositions
-
-
Constructor Details
-
Module
-
-
Method Details
-
periodic
-
runSetpoint
Runs the module with the specified setpoint state. Mutates the state to optimize it. -
runCharacterization
Runs the module with the specified output while controlling to zero degrees. -
stop
Disables all outputs to motors. -
getAngle
Returns the current turn angle of the module. -
getPositionMeters
Returns the current drive position of the module in meters. -
getVelocityMetersPerSec
Returns the current drive velocity of the module in meters per second. -
getPosition
Returns the module position (turn angle and drive position). -
getVelocity
Returns the module velocity (turn angle and drive velocity). -
getOdometryPositions
Returns the module positions received this cycle. -
getOdometryTimestamps
Returns the timestamps of the samples received this cycle. -
getWheelRadiusCharacterizationPosition
Returns the module position in radians. -
getFFCharacterizationVelocity
Returns the module velocity in rotations/sec (Phoenix native units). -
periodicAfterScheduler
-