Package edu.wpi.first.math.kinematics
Class MecanumDriveWheelPositions
java.lang.Object
edu.wpi.first.math.kinematics.MecanumDriveWheelPositions
- All Implemented Interfaces:
Interpolatable<MecanumDriveWheelPositions>
,WheelPositions<MecanumDriveWheelPositions>
public class MecanumDriveWheelPositions extends Object implements WheelPositions<MecanumDriveWheelPositions>
-
Field Summary
Fields Modifier and Type Field Description double
frontLeftMeters
Distance measured by the front left wheel.double
frontRightMeters
Distance measured by the front right wheel.double
rearLeftMeters
Distance measured by the rear left wheel.double
rearRightMeters
Distance measured by the rear right wheel. -
Constructor Summary
Constructors Constructor Description MecanumDriveWheelPositions()
Constructs a MecanumDriveWheelPositions with zeros for all member fields.MecanumDriveWheelPositions(double frontLeftMeters, double frontRightMeters, double rearLeftMeters, double rearRightMeters)
Constructs a MecanumDriveWheelPositions. -
Method Summary
Modifier and Type Method Description MecanumDriveWheelPositions
copy()
Returns a copy of this instance.boolean
equals(Object obj)
int
hashCode()
MecanumDriveWheelPositions
interpolate(MecanumDriveWheelPositions endValue, double t)
Return the interpolated value.MecanumDriveWheelPositions
minus(MecanumDriveWheelPositions other)
Returns the difference with another set of wheel positions.String
toString()
-
Field Details
-
frontLeftMeters
Distance measured by the front left wheel. -
frontRightMeters
Distance measured by the front right wheel. -
rearLeftMeters
Distance measured by the rear left wheel. -
rearRightMeters
Distance measured by the rear right wheel.
-
-
Constructor Details
-
MecanumDriveWheelPositions
public MecanumDriveWheelPositions()Constructs a MecanumDriveWheelPositions with zeros for all member fields. -
MecanumDriveWheelPositions
public MecanumDriveWheelPositions(double frontLeftMeters, double frontRightMeters, double rearLeftMeters, double rearRightMeters)Constructs a MecanumDriveWheelPositions.- Parameters:
frontLeftMeters
- Distance measured by the front left wheel.frontRightMeters
- Distance measured by the front right wheel.rearLeftMeters
- Distance measured by the rear left wheel.rearRightMeters
- Distance measured by the rear right wheel.
-
-
Method Details
-
equals
-
hashCode
-
toString
-
copy
Description copied from interface:WheelPositions
Returns a copy of this instance.- Specified by:
copy
in interfaceWheelPositions<MecanumDriveWheelPositions>
- Returns:
- A copy.
-
minus
Description copied from interface:WheelPositions
Returns the difference with another set of wheel positions.- Specified by:
minus
in interfaceWheelPositions<MecanumDriveWheelPositions>
- 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<MecanumDriveWheelPositions>
- 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.
-