Package com.pathplanner.lib.util.swerve
Record Class SwerveSetpoint
java.lang.Object
java.lang.Record
com.pathplanner.lib.util.swerve.SwerveSetpoint
- Record Components:
robotRelativeSpeeds
- Robot-relative chassis speedsmoduleStates
- 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(ChassisSpeeds robotRelativeSpeeds, SwerveModuleState[] moduleStates, DriveFeedforwards feedforwards)
extends Record
A setpoint for a swerve drivetrain, containing robot-relative chassis speeds and individual
module states
-
Constructor Summary
ConstructorDescriptionSwerveSetpoint
(ChassisSpeeds robotRelativeSpeeds, SwerveModuleState[] moduleStates, DriveFeedforwards feedforwards) Creates an instance of aSwerveSetpoint
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefeedforwards
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of themoduleStates
record component.Returns the value of therobotRelativeSpeeds
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SwerveSetpoint
public SwerveSetpoint(ChassisSpeeds robotRelativeSpeeds, SwerveModuleState[] moduleStates, DriveFeedforwards feedforwards) Creates an instance of aSwerveSetpoint
record class.- Parameters:
robotRelativeSpeeds
- the value for therobotRelativeSpeeds
record componentmoduleStates
- the value for themoduleStates
record componentfeedforwards
- the value for thefeedforwards
record 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)
. -
robotRelativeSpeeds
Returns the value of therobotRelativeSpeeds
record component.- Returns:
- the value of the
robotRelativeSpeeds
record component
-
moduleStates
Returns the value of themoduleStates
record component.- Returns:
- the value of the
moduleStates
record component
-
feedforwards
Returns the value of thefeedforwards
record component.- Returns:
- the value of the
feedforwards
record component
-