Class MecanumDriveWheelAccelerations
java.lang.Object
org.wpilib.math.kinematics.MecanumDriveWheelAccelerations
- All Implemented Interfaces:
Interpolatable<MecanumDriveWheelAccelerations>, ProtobufSerializable, StructSerializable, WPISerializable
public class MecanumDriveWheelAccelerations
extends Object
implements Interpolatable<MecanumDriveWheelAccelerations>, ProtobufSerializable, StructSerializable
Represents the wheel accelerations for a mecanum drive drivetrain.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleAcceleration of the front left wheel in meters per second squared.doubleAcceleration of the front right wheel in meters per second squared.static final MecanumDriveWheelAccelerationsProtoMecanumDriveWheelAccelerations protobuf for serialization.doubleAcceleration of the rear left wheel in meters per second squared.doubleAcceleration of the rear right wheel in meters per second squared.static final MecanumDriveWheelAccelerationsStructMecanumDriveWheelAccelerations struct for serialization. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a MecanumDriveWheelAccelerations with zeros for all member fields.MecanumDriveWheelAccelerations(double frontLeft, double frontRight, double rearLeft, double rearRight) Constructs a MecanumDriveWheelAccelerations.MecanumDriveWheelAccelerations(LinearAcceleration frontLeft, LinearAcceleration frontRight, LinearAcceleration rearLeft, LinearAcceleration rearRight) Constructs a MecanumDriveWheelAccelerations. -
Method Summary
Modifier and TypeMethodDescriptiondiv(double scalar) Divides the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.interpolate(MecanumDriveWheelAccelerations endValue, double t) Returns the linear interpolation of this MecanumDriveWheelAccelerations and another.Subtracts the other MecanumDriveWheelAccelerations from the current MecanumDriveWheelAccelerations and returns the difference.Adds two MecanumDriveWheelAccelerations and returns the sum.times(double scalar) Multiplies the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.toString()Returns the inverse of the current MecanumDriveWheelAccelerations.
-
Field Details
-
frontLeft
Acceleration of the front left wheel in meters per second squared. -
frontRight
Acceleration of the front right wheel in meters per second squared. -
rearLeft
Acceleration of the rear left wheel in meters per second squared. -
rearRight
Acceleration of the rear right wheel in meters per second squared. -
proto
MecanumDriveWheelAccelerations protobuf for serialization. -
struct
MecanumDriveWheelAccelerations struct for serialization.
-
-
Constructor Details
-
MecanumDriveWheelAccelerations
public MecanumDriveWheelAccelerations()Constructs a MecanumDriveWheelAccelerations with zeros for all member fields. -
MecanumDriveWheelAccelerations
public MecanumDriveWheelAccelerations(double frontLeft, double frontRight, double rearLeft, double rearRight) Constructs a MecanumDriveWheelAccelerations.- Parameters:
frontLeft- Acceleration of the front left wheel in meters per second squared.frontRight- Acceleration of the front right wheel in meters per second squared.rearLeft- Acceleration of the rear left wheel in meters per second squared.rearRight- Acceleration of the rear right wheel in meters per second squared.
-
MecanumDriveWheelAccelerations
public MecanumDriveWheelAccelerations(LinearAcceleration frontLeft, LinearAcceleration frontRight, LinearAcceleration rearLeft, LinearAcceleration rearRight) Constructs a MecanumDriveWheelAccelerations.- Parameters:
frontLeft- Acceleration of the front left wheel in meters per second squared.frontRight- Acceleration of the front right wheel in meters per second squared.rearLeft- Acceleration of the rear left wheel in meters per second squared.rearRight- Acceleration of the rear right wheel in meters per second squared.
-
-
Method Details
-
plus
Adds two MecanumDriveWheelAccelerations and returns the sum.For example, MecanumDriveWheelAccelerations{1.0, 0.5, 2.0, 1.5} + MecanumDriveWheelAccelerations{2.0, 1.5, 0.5, 1.0} = MecanumDriveWheelAccelerations{3.0, 2.0, 2.5, 2.5}
- Parameters:
other- The MecanumDriveWheelAccelerations to add.- Returns:
- The sum of the MecanumDriveWheelAccelerations.
-
minus
Subtracts the other MecanumDriveWheelAccelerations from the current MecanumDriveWheelAccelerations and returns the difference.For example, MecanumDriveWheelAccelerations{5.0, 4.0, 6.0, 2.5} - MecanumDriveWheelAccelerations{1.0, 2.0, 3.0, 0.5} = MecanumDriveWheelAccelerations{4.0, 2.0, 3.0, 2.0}
- Parameters:
other- The MecanumDriveWheelAccelerations to subtract.- Returns:
- The difference between the two MecanumDriveWheelAccelerations.
-
unaryMinus
Returns the inverse of the current MecanumDriveWheelAccelerations. This is equivalent to negating all components of the MecanumDriveWheelAccelerations.- Returns:
- The inverse of the current MecanumDriveWheelAccelerations.
-
times
Multiplies the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.For example, MecanumDriveWheelAccelerations{2.0, 2.5, 3.0, 3.5} * 2 = MecanumDriveWheelAccelerations{4.0, 5.0, 6.0, 7.0}
- Parameters:
scalar- The scalar to multiply by.- Returns:
- The scaled MecanumDriveWheelAccelerations.
-
div
Divides the MecanumDriveWheelAccelerations by a scalar and returns the new MecanumDriveWheelAccelerations.For example, MecanumDriveWheelAccelerations{2.0, 2.5, 1.5, 1.0} / 2 = MecanumDriveWheelAccelerations{1.0, 1.25, 0.75, 0.5}
- Parameters:
scalar- The scalar to divide by.- Returns:
- The scaled MecanumDriveWheelAccelerations.
-
interpolate
public MecanumDriveWheelAccelerations interpolate(MecanumDriveWheelAccelerations endValue, double t) Returns the linear interpolation of this MecanumDriveWheelAccelerations and another.- Specified by:
interpolatein interfaceInterpolatable<MecanumDriveWheelAccelerations>- Parameters:
endValue- The end value for the interpolation.t- How far between the two values to interpolate. This is clamped to [0, 1].- Returns:
- The interpolated value.
-
toString
-