Class DifferentialDriveWheelAccelerations

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

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

  • Constructor Details

    • DifferentialDriveWheelAccelerations

      Constructs a DifferentialDriveWheelAccelerations with zeros for left and right accelerations.
    • DifferentialDriveWheelAccelerations

      public DifferentialDriveWheelAccelerations(double left, double right)
      Constructs a DifferentialDriveWheelAccelerations.
      Parameters:
      left - The left acceleration in meters per second squared.
      right - The right acceleration in meters per second squared.
    • DifferentialDriveWheelAccelerations

      Constructs a DifferentialDriveWheelAccelerations.
      Parameters:
      left - The left acceleration in meters per second squared.
      right - The right acceleration in meters per second squared.
  • Method Details

    • plus

      Adds two DifferentialDriveWheelAccelerations and returns the sum.

      For example, DifferentialDriveWheelAccelerations{1.0, 0.5} + DifferentialDriveWheelAccelerations{2.0, 1.5} = DifferentialDriveWheelAccelerations{3.0, 2.0}

      Parameters:
      other - The DifferentialDriveWheelAccelerations to add.
      Returns:
      The sum of the DifferentialDriveWheelAccelerations.
    • minus

      Subtracts the other DifferentialDriveWheelAccelerations from the current DifferentialDriveWheelAccelerations and returns the difference.

      For example, DifferentialDriveWheelAccelerations{5.0, 4.0} - DifferentialDriveWheelAccelerations{1.0, 2.0} = DifferentialDriveWheelAccelerations{4.0, 2.0}

      Parameters:
      other - The DifferentialDriveWheelAccelerations to subtract.
      Returns:
      The difference between the two DifferentialDriveWheelAccelerations.
    • unaryMinus

      Returns the inverse of the current DifferentialDriveWheelAccelerations. This is equivalent to negating all components of the DifferentialDriveWheelAccelerations.
      Returns:
      The inverse of the current DifferentialDriveWheelAccelerations.
    • times

      Multiplies the DifferentialDriveWheelAccelerations by a scalar and returns the new DifferentialDriveWheelAccelerations.

      For example, DifferentialDriveWheelAccelerations{2.0, 2.5} * 2 = DifferentialDriveWheelAccelerations{4.0, 5.0}

      Parameters:
      scalar - The scalar to multiply by.
      Returns:
      The scaled DifferentialDriveWheelAccelerations.
    • div

      public DifferentialDriveWheelAccelerations div(double scalar)
      Divides the DifferentialDriveWheelAccelerations by a scalar and returns the new DifferentialDriveWheelAccelerations.

      For example, DifferentialDriveWheelAccelerations{2.0, 2.5} / 2 = DifferentialDriveWheelAccelerations{1.0, 1.25}

      Parameters:
      scalar - The scalar to divide by.
      Returns:
      The scaled DifferentialDriveWheelAccelerations.
    • interpolate

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