Record Class SwerveConfig

java.lang.Object
java.lang.Record
com.marslib.swerve.SwerveConfig

public record SwerveConfig(edu.wpi.first.math.geometry.Translation2d[] moduleLocations, double maxLinearSpeedMps, double maxAngularSpeedRadPerSec, double wheelRadiusMeters, double turnKp, double nominalVoltage, double warningVoltage, double criticalVoltage, double driveGearRatio, double driveStatorCurrentLimit, double robotMassKg, double robotMoiKgM2, double bumperLengthMeters, double bumperWidthMeters, double wheelbaseMeters, double trackWidthMeters, double wheelCOFStatic, double loopPeriodSecs, double teleopLinearAccelLimit, double teleopOmegaAccelLimit, double headingKp, double autoTranslationKp, double autoTranslationKd, double autoRotationKp, double autoRotationKd, double alignTranslationKp, double alignTranslationIZoneMeters, double alignThetaKp, double alignThetaIZoneRad, double telemetryHz, double odometryHz, double turnGearRatio, double turnStatorCurrentLimit) extends Record
Configuration record for the SwerveDrive subsystem.

This object encapsulates all physical, kinematic, and structural parameters, allowing the library to remain data-driven and independent of the robot's constant files.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SwerveConfig(edu.wpi.first.math.geometry.Translation2d[] moduleLocations, double maxLinearSpeedMps, double maxAngularSpeedRadPerSec, double wheelRadiusMeters, double turnKp, double nominalVoltage, double warningVoltage, double criticalVoltage, double driveGearRatio, double driveStatorCurrentLimit, double robotMassKg, double robotMoiKgM2, double bumperLengthMeters, double bumperWidthMeters, double wheelbaseMeters, double trackWidthMeters, double wheelCOFStatic, double loopPeriodSecs, double teleopLinearAccelLimit, double teleopOmegaAccelLimit, double headingKp, double autoTranslationKp, double autoTranslationKd, double autoRotationKp, double autoRotationKd, double alignTranslationKp, double alignTranslationIZoneMeters, double alignThetaKp, double alignThetaIZoneRad, double telemetryHz, double odometryHz, double turnGearRatio, double turnStatorCurrentLimit)
    Creates an instance of a SwerveConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the alignThetaIZoneRad record component.
    double
    Returns the value of the alignThetaKp record component.
    double
    Returns the value of the alignTranslationIZoneMeters record component.
    double
    Returns the value of the alignTranslationKp record component.
    double
    Returns the value of the autoRotationKd record component.
    double
    Returns the value of the autoRotationKp record component.
    double
    Returns the value of the autoTranslationKd record component.
    double
    Returns the value of the autoTranslationKp record component.
    double
    Returns the value of the bumperLengthMeters record component.
    double
    Returns the value of the bumperWidthMeters record component.
    double
    Returns the value of the criticalVoltage record component.
    double
    Returns the value of the driveGearRatio record component.
    double
    Returns the value of the driveStatorCurrentLimit record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the headingKp record component.
    double
    Returns the value of the loopPeriodSecs record component.
    double
    Returns the value of the maxAngularSpeedRadPerSec record component.
    double
    Returns the value of the maxLinearSpeedMps record component.
    edu.wpi.first.math.geometry.Translation2d[]
    Returns the value of the moduleLocations record component.
    double
    Returns the value of the nominalVoltage record component.
    double
    Returns the value of the odometryHz record component.
    double
    Returns the value of the robotMassKg record component.
    double
    Returns the value of the robotMoiKgM2 record component.
    double
    Returns the value of the telemetryHz record component.
    double
    Returns the value of the teleopLinearAccelLimit record component.
    double
    Returns the value of the teleopOmegaAccelLimit record component.
    final String
    Returns a string representation of this record class.
    double
    Returns the value of the trackWidthMeters record component.
    double
    Returns the value of the turnGearRatio record component.
    double
    Returns the value of the turnKp record component.
    double
    Returns the value of the turnStatorCurrentLimit record component.
    double
    Returns the value of the warningVoltage record component.
    double
    Returns the value of the wheelbaseMeters record component.
    double
    Returns the value of the wheelCOFStatic record component.
    double
    Returns the value of the wheelRadiusMeters record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SwerveConfig

      public SwerveConfig(edu.wpi.first.math.geometry.Translation2d[] moduleLocations, double maxLinearSpeedMps, double maxAngularSpeedRadPerSec, double wheelRadiusMeters, double turnKp, double nominalVoltage, double warningVoltage, double criticalVoltage, double driveGearRatio, double driveStatorCurrentLimit, double robotMassKg, double robotMoiKgM2, double bumperLengthMeters, double bumperWidthMeters, double wheelbaseMeters, double trackWidthMeters, double wheelCOFStatic, double loopPeriodSecs, double teleopLinearAccelLimit, double teleopOmegaAccelLimit, double headingKp, double autoTranslationKp, double autoTranslationKd, double autoRotationKp, double autoRotationKd, double alignTranslationKp, double alignTranslationIZoneMeters, double alignThetaKp, double alignThetaIZoneRad, double telemetryHz, double odometryHz, double turnGearRatio, double turnStatorCurrentLimit)
      Creates an instance of a SwerveConfig record class.
      Parameters:
      moduleLocations - the value for the moduleLocations record component
      maxLinearSpeedMps - the value for the maxLinearSpeedMps record component
      maxAngularSpeedRadPerSec - the value for the maxAngularSpeedRadPerSec record component
      wheelRadiusMeters - the value for the wheelRadiusMeters record component
      turnKp - the value for the turnKp record component
      nominalVoltage - the value for the nominalVoltage record component
      warningVoltage - the value for the warningVoltage record component
      criticalVoltage - the value for the criticalVoltage record component
      driveGearRatio - the value for the driveGearRatio record component
      driveStatorCurrentLimit - the value for the driveStatorCurrentLimit record component
      robotMassKg - the value for the robotMassKg record component
      robotMoiKgM2 - the value for the robotMoiKgM2 record component
      bumperLengthMeters - the value for the bumperLengthMeters record component
      bumperWidthMeters - the value for the bumperWidthMeters record component
      wheelbaseMeters - the value for the wheelbaseMeters record component
      trackWidthMeters - the value for the trackWidthMeters record component
      wheelCOFStatic - the value for the wheelCOFStatic record component
      loopPeriodSecs - the value for the loopPeriodSecs record component
      teleopLinearAccelLimit - the value for the teleopLinearAccelLimit record component
      teleopOmegaAccelLimit - the value for the teleopOmegaAccelLimit record component
      headingKp - the value for the headingKp record component
      autoTranslationKp - the value for the autoTranslationKp record component
      autoTranslationKd - the value for the autoTranslationKd record component
      autoRotationKp - the value for the autoRotationKp record component
      autoRotationKd - the value for the autoRotationKd record component
      alignTranslationKp - the value for the alignTranslationKp record component
      alignTranslationIZoneMeters - the value for the alignTranslationIZoneMeters record component
      alignThetaKp - the value for the alignThetaKp record component
      alignThetaIZoneRad - the value for the alignThetaIZoneRad record component
      telemetryHz - the value for the telemetryHz record component
      odometryHz - the value for the odometryHz record component
      turnGearRatio - the value for the turnGearRatio record component
      turnStatorCurrentLimit - the value for the turnStatorCurrentLimit record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • moduleLocations

      public edu.wpi.first.math.geometry.Translation2d[] moduleLocations()
      Returns the value of the moduleLocations record component.
      Returns:
      the value of the moduleLocations record component
    • maxLinearSpeedMps

      public double maxLinearSpeedMps()
      Returns the value of the maxLinearSpeedMps record component.
      Returns:
      the value of the maxLinearSpeedMps record component
    • maxAngularSpeedRadPerSec

      public double maxAngularSpeedRadPerSec()
      Returns the value of the maxAngularSpeedRadPerSec record component.
      Returns:
      the value of the maxAngularSpeedRadPerSec record component
    • wheelRadiusMeters

      public double wheelRadiusMeters()
      Returns the value of the wheelRadiusMeters record component.
      Returns:
      the value of the wheelRadiusMeters record component
    • turnKp

      public double turnKp()
      Returns the value of the turnKp record component.
      Returns:
      the value of the turnKp record component
    • nominalVoltage

      public double nominalVoltage()
      Returns the value of the nominalVoltage record component.
      Returns:
      the value of the nominalVoltage record component
    • warningVoltage

      public double warningVoltage()
      Returns the value of the warningVoltage record component.
      Returns:
      the value of the warningVoltage record component
    • criticalVoltage

      public double criticalVoltage()
      Returns the value of the criticalVoltage record component.
      Returns:
      the value of the criticalVoltage record component
    • driveGearRatio

      public double driveGearRatio()
      Returns the value of the driveGearRatio record component.
      Returns:
      the value of the driveGearRatio record component
    • driveStatorCurrentLimit

      public double driveStatorCurrentLimit()
      Returns the value of the driveStatorCurrentLimit record component.
      Returns:
      the value of the driveStatorCurrentLimit record component
    • robotMassKg

      public double robotMassKg()
      Returns the value of the robotMassKg record component.
      Returns:
      the value of the robotMassKg record component
    • robotMoiKgM2

      public double robotMoiKgM2()
      Returns the value of the robotMoiKgM2 record component.
      Returns:
      the value of the robotMoiKgM2 record component
    • bumperLengthMeters

      public double bumperLengthMeters()
      Returns the value of the bumperLengthMeters record component.
      Returns:
      the value of the bumperLengthMeters record component
    • bumperWidthMeters

      public double bumperWidthMeters()
      Returns the value of the bumperWidthMeters record component.
      Returns:
      the value of the bumperWidthMeters record component
    • wheelbaseMeters

      public double wheelbaseMeters()
      Returns the value of the wheelbaseMeters record component.
      Returns:
      the value of the wheelbaseMeters record component
    • trackWidthMeters

      public double trackWidthMeters()
      Returns the value of the trackWidthMeters record component.
      Returns:
      the value of the trackWidthMeters record component
    • wheelCOFStatic

      public double wheelCOFStatic()
      Returns the value of the wheelCOFStatic record component.
      Returns:
      the value of the wheelCOFStatic record component
    • loopPeriodSecs

      public double loopPeriodSecs()
      Returns the value of the loopPeriodSecs record component.
      Returns:
      the value of the loopPeriodSecs record component
    • teleopLinearAccelLimit

      public double teleopLinearAccelLimit()
      Returns the value of the teleopLinearAccelLimit record component.
      Returns:
      the value of the teleopLinearAccelLimit record component
    • teleopOmegaAccelLimit

      public double teleopOmegaAccelLimit()
      Returns the value of the teleopOmegaAccelLimit record component.
      Returns:
      the value of the teleopOmegaAccelLimit record component
    • headingKp

      public double headingKp()
      Returns the value of the headingKp record component.
      Returns:
      the value of the headingKp record component
    • autoTranslationKp

      public double autoTranslationKp()
      Returns the value of the autoTranslationKp record component.
      Returns:
      the value of the autoTranslationKp record component
    • autoTranslationKd

      public double autoTranslationKd()
      Returns the value of the autoTranslationKd record component.
      Returns:
      the value of the autoTranslationKd record component
    • autoRotationKp

      public double autoRotationKp()
      Returns the value of the autoRotationKp record component.
      Returns:
      the value of the autoRotationKp record component
    • autoRotationKd

      public double autoRotationKd()
      Returns the value of the autoRotationKd record component.
      Returns:
      the value of the autoRotationKd record component
    • alignTranslationKp

      public double alignTranslationKp()
      Returns the value of the alignTranslationKp record component.
      Returns:
      the value of the alignTranslationKp record component
    • alignTranslationIZoneMeters

      public double alignTranslationIZoneMeters()
      Returns the value of the alignTranslationIZoneMeters record component.
      Returns:
      the value of the alignTranslationIZoneMeters record component
    • alignThetaKp

      public double alignThetaKp()
      Returns the value of the alignThetaKp record component.
      Returns:
      the value of the alignThetaKp record component
    • alignThetaIZoneRad

      public double alignThetaIZoneRad()
      Returns the value of the alignThetaIZoneRad record component.
      Returns:
      the value of the alignThetaIZoneRad record component
    • telemetryHz

      public double telemetryHz()
      Returns the value of the telemetryHz record component.
      Returns:
      the value of the telemetryHz record component
    • odometryHz

      public double odometryHz()
      Returns the value of the odometryHz record component.
      Returns:
      the value of the odometryHz record component
    • turnGearRatio

      public double turnGearRatio()
      Returns the value of the turnGearRatio record component.
      Returns:
      the value of the turnGearRatio record component
    • turnStatorCurrentLimit

      public double turnStatorCurrentLimit()
      Returns the value of the turnStatorCurrentLimit record component.
      Returns:
      the value of the turnStatorCurrentLimit record component