Package xbot.common.subsystems.drive
Record Class SwervePointKinematics
java.lang.Object
java.lang.Record
xbot.common.subsystems.drive.SwervePointKinematics
public record SwervePointKinematics(LinearAcceleration acceleration, LinearVelocity initialVelocity, LinearVelocity goalVelocity, LinearVelocity maxVelocity)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSwervePointKinematics(double acceleration, double initialVelocity, double goalVelocity, double maxVelocity) Creates a set of Kinematics values with METERSSwervePointKinematics(LinearAcceleration acceleration, LinearVelocity initialVelocity, LinearVelocity goalVelocity, LinearVelocity maxVelocity) Creates an instance of aSwervePointKinematicsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccelerationrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegoalVelocityrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinitialVelocityrecord component.kinematicsWithNewInitialVelocity(LinearVelocity newInitialVelocity) Returns the value of themaxVelocityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SwervePointKinematics
public SwervePointKinematics(double acceleration, double initialVelocity, double goalVelocity, double maxVelocity) Creates a set of Kinematics values with METERS- Parameters:
acceleration- in meters/second^2initialVelocity- in meters/second; velocity at startgoalVelocity- in meters/second; velocity we WANT to end at, in range of [-maxVelocity, maxVelocity]maxVelocity- in meters/second; max speed constraint
-
SwervePointKinematics
public SwervePointKinematics(LinearAcceleration acceleration, LinearVelocity initialVelocity, LinearVelocity goalVelocity, LinearVelocity maxVelocity) Creates an instance of aSwervePointKinematicsrecord class.- Parameters:
acceleration- the value for theaccelerationrecord componentinitialVelocity- the value for theinitialVelocityrecord componentgoalVelocity- the value for thegoalVelocityrecord componentmaxVelocity- the value for themaxVelocityrecord component
-
-
Method Details
-
kinematicsWithNewInitialVelocity
- Parameters:
newInitialVelocity- for the set of kinematics- Returns:
- a new set of kinematics values!
-
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). -
acceleration
Returns the value of theaccelerationrecord component.- Returns:
- the value of the
accelerationrecord component
-
initialVelocity
Returns the value of theinitialVelocityrecord component.- Returns:
- the value of the
initialVelocityrecord component
-
goalVelocity
Returns the value of thegoalVelocityrecord component.- Returns:
- the value of the
goalVelocityrecord component
-
maxVelocity
Returns the value of themaxVelocityrecord component.- Returns:
- the value of the
maxVelocityrecord component
-