Record Class SwervePointKinematics
java.lang.Object
java.lang.Record
xbot.common.subsystems.drive.SwervePointKinematics
public record SwervePointKinematics(org.wpilib.units.measure.LinearAcceleration acceleration, org.wpilib.units.measure.LinearVelocity initialVelocity, org.wpilib.units.measure.LinearVelocity goalVelocity, org.wpilib.units.measure.LinearVelocity maxVelocity)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSwervePointKinematics(double acceleration, double initialVelocity, double goalVelocity, double maxVelocity) Creates a set of Kinematics values with METERSSwervePointKinematics(org.wpilib.units.measure.LinearAcceleration acceleration, org.wpilib.units.measure.LinearVelocity initialVelocity, org.wpilib.units.measure.LinearVelocity goalVelocity, org.wpilib.units.measure.LinearVelocity maxVelocity) Creates an instance of aSwervePointKinematicsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.wpilib.units.measure.LinearAccelerationReturns the value of theaccelerationrecord component.final booleanIndicates whether some other object is "equal to" this one.org.wpilib.units.measure.LinearVelocityReturns the value of thegoalVelocityrecord component.final inthashCode()Returns a hash code value for this object.org.wpilib.units.measure.LinearVelocityReturns the value of theinitialVelocityrecord component.kinematicsWithNewInitialVelocity(org.wpilib.units.measure.LinearVelocity newInitialVelocity) org.wpilib.units.measure.LinearVelocityReturns 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(org.wpilib.units.measure.LinearAcceleration acceleration, org.wpilib.units.measure.LinearVelocity initialVelocity, org.wpilib.units.measure.LinearVelocity goalVelocity, org.wpilib.units.measure.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
public SwervePointKinematics kinematicsWithNewInitialVelocity(org.wpilib.units.measure.LinearVelocity newInitialVelocity) - Parameters:
newInitialVelocity- for the set of kinematics- Returns:
- a new set of kinematics values!
-
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). -
acceleration
public org.wpilib.units.measure.LinearAcceleration acceleration()Returns the value of theaccelerationrecord component.- Returns:
- the value of the
accelerationrecord component
-
initialVelocity
public org.wpilib.units.measure.LinearVelocity initialVelocity()Returns the value of theinitialVelocityrecord component.- Returns:
- the value of the
initialVelocityrecord component
-
goalVelocity
public org.wpilib.units.measure.LinearVelocity goalVelocity()Returns the value of thegoalVelocityrecord component.- Returns:
- the value of the
goalVelocityrecord component
-
maxVelocity
public org.wpilib.units.measure.LinearVelocity maxVelocity()Returns the value of themaxVelocityrecord component.- Returns:
- the value of the
maxVelocityrecord component
-