Record Class SwerveModuleStates
java.lang.Object
java.lang.Record
xbot.common.subsystems.drive.swerve.SwerveModuleStates
public record SwerveModuleStates(org.wpilib.math.kinematics.SwerveModuleVelocity frontLeft, org.wpilib.math.kinematics.SwerveModuleVelocity frontRight, org.wpilib.math.kinematics.SwerveModuleVelocity rearLeft, org.wpilib.math.kinematics.SwerveModuleVelocity rearRight)
extends Record
A simple record to hold the states of all four swerve modules.
-
Constructor Summary
ConstructorsConstructorDescriptionSwerveModuleStates(org.wpilib.math.kinematics.SwerveModuleVelocity frontLeft, org.wpilib.math.kinematics.SwerveModuleVelocity frontRight, org.wpilib.math.kinematics.SwerveModuleVelocity rearLeft, org.wpilib.math.kinematics.SwerveModuleVelocity rearRight) Creates an instance of aSwerveModuleStatesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.wpilib.math.kinematics.SwerveModuleVelocityReturns the value of thefrontLeftrecord component.org.wpilib.math.kinematics.SwerveModuleVelocityReturns the value of thefrontRightrecord component.final inthashCode()Returns a hash code value for this object.org.wpilib.math.kinematics.SwerveModuleVelocityrearLeft()Returns the value of therearLeftrecord component.org.wpilib.math.kinematics.SwerveModuleVelocityReturns the value of therearRightrecord component.org.wpilib.math.kinematics.SwerveModuleVelocity[]toArray()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SwerveModuleStates
public SwerveModuleStates(org.wpilib.math.kinematics.SwerveModuleVelocity frontLeft, org.wpilib.math.kinematics.SwerveModuleVelocity frontRight, org.wpilib.math.kinematics.SwerveModuleVelocity rearLeft, org.wpilib.math.kinematics.SwerveModuleVelocity rearRight) Creates an instance of aSwerveModuleStatesrecord class.- Parameters:
frontLeft- the value for thefrontLeftrecord componentfrontRight- the value for thefrontRightrecord componentrearLeft- the value for therearLeftrecord componentrearRight- the value for therearRightrecord component
-
-
Method Details
-
toArray
public org.wpilib.math.kinematics.SwerveModuleVelocity[] toArray() -
toString
-
hashCode
-
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). -
frontLeft
public org.wpilib.math.kinematics.SwerveModuleVelocity frontLeft()Returns the value of thefrontLeftrecord component.- Returns:
- the value of the
frontLeftrecord component
-
frontRight
public org.wpilib.math.kinematics.SwerveModuleVelocity frontRight()Returns the value of thefrontRightrecord component.- Returns:
- the value of the
frontRightrecord component
-
rearLeft
public org.wpilib.math.kinematics.SwerveModuleVelocity rearLeft()Returns the value of therearLeftrecord component.- Returns:
- the value of the
rearLeftrecord component
-
rearRight
public org.wpilib.math.kinematics.SwerveModuleVelocity rearRight()Returns the value of therearRightrecord component.- Returns:
- the value of the
rearRightrecord component
-