Package edu.wpi.first.math.kinematics
Class SwerveDriveWheelPositions
java.lang.Object
edu.wpi.first.math.kinematics.SwerveDriveWheelPositions
- All Implemented Interfaces:
Interpolatable<SwerveDriveWheelPositions>
,WheelPositions<SwerveDriveWheelPositions>
public class SwerveDriveWheelPositions extends Object implements WheelPositions<SwerveDriveWheelPositions>
Represents the wheel positions for a swerve drive drivetrain.
-
Field Summary
Fields Modifier and Type Field Description SwerveModulePosition[]
positions
The distances driven by the wheels. -
Constructor Summary
Constructors Constructor Description SwerveDriveWheelPositions(SwerveModulePosition[] positions)
Creates a new SwerveDriveWheelPositions instance. -
Method Summary
Modifier and Type Method Description SwerveDriveWheelPositions
copy()
Returns a copy of this instance.boolean
equals(Object obj)
int
hashCode()
SwerveDriveWheelPositions
interpolate(SwerveDriveWheelPositions endValue, double t)
Return the interpolated value.String
toString()
-
Field Details
-
positions
The distances driven by the wheels.
-
-
Constructor Details
-
SwerveDriveWheelPositions
Creates a new SwerveDriveWheelPositions instance.- Parameters:
positions
- The swerve module positions. This will be deeply copied.
-
-
Method Details
-
equals
-
hashCode
-
toString
-
copy
Description copied from interface:WheelPositions
Returns a copy of this instance.- Specified by:
copy
in interfaceWheelPositions<SwerveDriveWheelPositions>
- Returns:
- A copy.
-
interpolate
Description copied from interface:Interpolatable
Return the interpolated value. This object is assumed to be the starting position, or lower bound.- Specified by:
interpolate
in interfaceInterpolatable<SwerveDriveWheelPositions>
- Parameters:
endValue
- The upper bound, or end.t
- How far between the lower and upper bound we are. This should be bounded in [0, 1].- Returns:
- The interpolated value.
-