Record Class Swerve.Bundle

java.lang.Object
java.lang.Record
frc.robot.subsystems.swerve.Swerve.Bundle
Record Components:
swerve - the swerve drive subsystem instance
drivetrainState - the drivetrain state estimator associated with the swerve subsystem
Enclosing class:
Swerve

public static record Swerve.Bundle(Swerve swerve, DrivetrainState drivetrainState) extends Record
Simple container type that bundles together the Swerve subsystem and its associated DrivetrainState estimator.

This record is used to pass around both the high-level swerve drive control interface and the underlying drivetrain state estimation as a single unit. It does not itself construct or initialize any hardware or background processing; it only stores references to the provided instances.

  • Constructor Details

    • Bundle

      public Bundle(Swerve swerve, DrivetrainState drivetrainState)
      Creates an instance of a Bundle record class.
      Parameters:
      swerve - the value for the swerve record component
      drivetrainState - the value for the drivetrainState 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.
    • swerve

      public Swerve swerve()
      Returns the value of the swerve record component.
      Returns:
      the value of the swerve record component
    • drivetrainState

      public DrivetrainState drivetrainState()
      Returns the value of the drivetrainState record component.
      Returns:
      the value of the drivetrainState record component