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 aSwervePointKinematics
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacceleration
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thegoalVelocity
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinitialVelocity
record component.kinematicsWithNewInitialVelocity
(LinearVelocity newInitialVelocity) Returns the value of themaxVelocity
record component.final String
toString()
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 aSwervePointKinematics
record class.- Parameters:
acceleration
- the value for theacceleration
record componentinitialVelocity
- the value for theinitialVelocity
record componentgoalVelocity
- the value for thegoalVelocity
record componentmaxVelocity
- the value for themaxVelocity
record 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 theacceleration
record component.- Returns:
- the value of the
acceleration
record component
-
initialVelocity
Returns the value of theinitialVelocity
record component.- Returns:
- the value of the
initialVelocity
record component
-
goalVelocity
Returns the value of thegoalVelocity
record component.- Returns:
- the value of the
goalVelocity
record component
-
maxVelocity
Returns the value of themaxVelocity
record component.- Returns:
- the value of the
maxVelocity
record component
-