Class SwerveModule

java.lang.Object
frc.robot.Subsystems.DriveTrain.SwerveModule
Direct Known Subclasses:
SwerveModuleRealIO, SwerveModuleSimIO

public abstract class SwerveModule extends Object
Represents a single swerve module.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    edu.wpi.first.math.kinematics.SwerveModuleState
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Class constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    setAngle(edu.wpi.first.math.geometry.Rotation2d angle)
     
    protected abstract void
    setSpeed(double speed)
     
    void
    setState(edu.wpi.first.math.kinematics.SwerveModuleState state)
    Sets the target state for this module.
    void
    Resends input to the motors.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)