Package frc.robot.Subsystems.DriveTrain
Class SwerveModule
java.lang.Object
frc.robot.Subsystems.DriveTrain.SwerveModule
- Direct Known Subclasses:
SwerveModuleRealIO,SwerveModuleSimIO
Represents a single swerve module.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleedu.wpi.first.math.kinematics.SwerveModuleState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidsetAngle(edu.wpi.first.math.geometry.Rotation2d angle) protected abstract voidsetSpeed(double speed) voidsetState(edu.wpi.first.math.kinematics.SwerveModuleState state) Sets the target state for this module.voidupdate()Resends input to the motors.
-
Field Details
-
target_state
public edu.wpi.first.math.kinematics.SwerveModuleState target_state -
acceleration_ff
public double acceleration_ff
-
-
Constructor Details
-
SwerveModule
protected SwerveModule()Class constructor.
-
-
Method Details
-
setState
public void setState(edu.wpi.first.math.kinematics.SwerveModuleState state) Sets the target state for this module.- Parameters:
state- The new target state.
-
update
public void update()Resends input to the motors. -
setSpeed
protected abstract void setSpeed(double speed) -
setAngle
protected abstract void setAngle(edu.wpi.first.math.geometry.Rotation2d angle)
-