Class MecanumDriveWheelAccelerations

java.lang.Object
org.wpilib.math.kinematics.MecanumDriveWheelAccelerations
All Implemented Interfaces:
Interpolatable<MecanumDriveWheelAccelerations>, ProtobufSerializable, StructSerializable, WPISerializable

Represents the wheel accelerations for a mecanum drive drivetrain.
  • Field Details

    • frontLeft

      public double frontLeft
      Acceleration of the front left wheel in meters per second squared.
    • frontRight

      public double frontRight
      Acceleration of the front right wheel in meters per second squared.
    • rearLeft

      public double rearLeft
      Acceleration of the rear left wheel in meters per second squared.
    • rearRight

      public double 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

      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

      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

      public MecanumDriveWheelAccelerations times(double scalar)
      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

      public MecanumDriveWheelAccelerations div(double scalar)
      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

      Returns the linear interpolation of this MecanumDriveWheelAccelerations and another.
      Specified by:
      interpolate in interface Interpolatable<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

      public String toString()
      Overrides:
      toString in class Object