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>
-
Field Summary
Fields Modifier and Type Field Description SwerveModulePosition[]
positions
-
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.SwerveDriveWheelPositions
minus(SwerveDriveWheelPositions other)
Returns the difference with another set of wheel positions.String
toString()
-
Field Details
-
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.
-
minus
Description copied from interface:WheelPositions
Returns the difference with another set of wheel positions.- Specified by:
minus
in interfaceWheelPositions<SwerveDriveWheelPositions>
- Parameters:
other
- The other instance to compare to.- Returns:
- The representation of how the wheels moved from other to this.
-
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.
-