Record Class SwerveSetpoint

java.lang.Object
java.lang.Record
frc.lib.pathplanner.SwerveSetpoint
Record Components:
robotRelativeSpeeds - Robot-relative chassis speeds
moduleStates - Array of individual swerve module states. These will be in FL, FR, BL, BR order.
feedforwards - Feedforwards for each module's drive motor. The arrays in this record will be in FL, FR, BL, BR order.

public record SwerveSetpoint(edu.wpi.first.math.kinematics.ChassisSpeeds robotRelativeSpeeds, edu.wpi.first.math.kinematics.SwerveModuleState[] moduleStates, com.pathplanner.lib.util.DriveFeedforwards feedforwards) extends Record
A setpoint for a swerve drivetrain, containing robot-relative chassis speeds and individual module states
  • Constructor Summary

    Constructors
    Constructor
    Description
    SwerveSetpoint(edu.wpi.first.math.kinematics.ChassisSpeeds robotRelativeSpeeds, edu.wpi.first.math.kinematics.SwerveModuleState[] moduleStates, com.pathplanner.lib.util.DriveFeedforwards feedforwards)
    Creates an instance of a SwerveSetpoint record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    com.pathplanner.lib.util.DriveFeedforwards
    Returns the value of the feedforwards record component.
    final int
    Returns a hash code value for this object.
    edu.wpi.first.math.kinematics.SwerveModuleState[]
    Returns the value of the moduleStates record component.
    edu.wpi.first.math.kinematics.ChassisSpeeds
    Returns the value of the robotRelativeSpeeds record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • SwerveSetpoint

      public SwerveSetpoint(edu.wpi.first.math.kinematics.ChassisSpeeds robotRelativeSpeeds, edu.wpi.first.math.kinematics.SwerveModuleState[] moduleStates, com.pathplanner.lib.util.DriveFeedforwards feedforwards)
      Creates an instance of a SwerveSetpoint record class.
      Parameters:
      robotRelativeSpeeds - the value for the robotRelativeSpeeds record component
      moduleStates - the value for the moduleStates record component
      feedforwards - the value for the feedforwards 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • robotRelativeSpeeds

      public edu.wpi.first.math.kinematics.ChassisSpeeds robotRelativeSpeeds()
      Returns the value of the robotRelativeSpeeds record component.
      Returns:
      the value of the robotRelativeSpeeds record component
    • moduleStates

      public edu.wpi.first.math.kinematics.SwerveModuleState[] moduleStates()
      Returns the value of the moduleStates record component.
      Returns:
      the value of the moduleStates record component
    • feedforwards

      public com.pathplanner.lib.util.DriveFeedforwards feedforwards()
      Returns the value of the feedforwards record component.
      Returns:
      the value of the feedforwards record component