Package frc.robot.subsystems.swerve
Record Class Swerve.Bundle
java.lang.Object
java.lang.Record
frc.robot.subsystems.swerve.Swerve.Bundle
- Record Components:
swerve- the swerve drive subsystem instancedrivetrainState- the drivetrain state estimator associated with the swerve subsystem
- Enclosing class:
- Swerve
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 Summary
ConstructorsConstructorDescriptionBundle(Swerve swerve, DrivetrainState drivetrainState) Creates an instance of aBundlerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedrivetrainStaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.swerve()Returns the value of theswerverecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Bundle
Creates an instance of aBundlerecord class.- Parameters:
swerve- the value for theswerverecord componentdrivetrainState- the value for thedrivetrainStaterecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
swerve
Returns the value of theswerverecord component.- Returns:
- the value of the
swerverecord component
-
drivetrainState
Returns the value of thedrivetrainStaterecord component.- Returns:
- the value of the
drivetrainStaterecord component
-