Package frc.lib.pathplanner
Record Class SwerveSetpoint
java.lang.Object
java.lang.Record
frc.lib.pathplanner.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(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
ConstructorsConstructorDescriptionSwerveSetpoint(edu.wpi.first.math.kinematics.ChassisSpeeds robotRelativeSpeeds, edu.wpi.first.math.kinematics.SwerveModuleState[] moduleStates, com.pathplanner.lib.util.DriveFeedforwards feedforwards) Creates an instance of aSwerveSetpointrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.com.pathplanner.lib.util.DriveFeedforwardsReturns the value of thefeedforwardsrecord component.final inthashCode()Returns a hash code value for this object.edu.wpi.first.math.kinematics.SwerveModuleState[]Returns the value of themoduleStatesrecord component.edu.wpi.first.math.kinematics.ChassisSpeedsReturns the value of therobotRelativeSpeedsrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aSwerveSetpointrecord class.- Parameters:
robotRelativeSpeeds- the value for therobotRelativeSpeedsrecord componentmoduleStates- the value for themoduleStatesrecord componentfeedforwards- the value for thefeedforwardsrecord 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
public edu.wpi.first.math.kinematics.ChassisSpeeds robotRelativeSpeeds()Returns the value of therobotRelativeSpeedsrecord component.- Returns:
- the value of the
robotRelativeSpeedsrecord component
-
moduleStates
public edu.wpi.first.math.kinematics.SwerveModuleState[] moduleStates()Returns the value of themoduleStatesrecord component.- Returns:
- the value of the
moduleStatesrecord component
-
feedforwards
public com.pathplanner.lib.util.DriveFeedforwards feedforwards()Returns the value of thefeedforwardsrecord component.- Returns:
- the value of the
feedforwardsrecord component
-