edu.wpi.first.wpilibj.drive

## Class KilloughDrive

- java.lang.Object
- - edu.wpi.first.wpilibj.drive.RobotDriveBase
  - - edu.wpi.first.wpilibj.drive.KilloughDrive

- All Implemented Interfaces:
    MotorSafety

      public class KilloughDrive
      extends RobotDriveBase

  A class for driving Killough drive platforms.

  Killough drives are triangular with one omni wheel on each corner.

  Drive base diagram:

        /_____\
       / \   / \
          \ /
          ---

  Each drive() function provides different inverse kinematic relations for a Killough drive. The default wheel vectors are parallel to their respective opposite sides, but can be overridden. See the constructor for more information.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.drive.RobotDriveBase

      `RobotDriveBase.MotorType`

  - ### Field Summary

    - ### Fields inherited from class edu.wpi.first.wpilibj.drive.RobotDriveBase

      `m_deadband, m_maxOutput, m_safetyHelper`

    - ### Fields inherited from interface edu.wpi.first.wpilibj.MotorSafety

      `DEFAULT_SAFETY_EXPIRATION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KilloughDrive(SpeedController leftMotor, SpeedController rightMotor, SpeedController backMotor)` Construct a Killough drive with the given motors and default motor angles.
    `KilloughDrive(SpeedController leftMotor, SpeedController rightMotor, SpeedController backMotor, double leftMotorAngle, double rightMotorAngle, double backMotorAngle)` Construct a Killough drive with the given motors.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `driveCartesian(double x, double y, double rotation)` Drive method for Killough platform.
    `void` | `driveCartesian(double x, double y, double rotation, double gyroAngle)` Drive method for Killough platform.
    `void` | `drivePolar(double magnitude, double angle, double rotation)` Drive method for Killough platform.
    `java.lang.String` | `getDescription()`
    `void` | `stopMotor()`

    - ### Methods inherited from class edu.wpi.first.wpilibj.drive.RobotDriveBase

      `applyDeadband, getExpiration, isAlive, isSafetyEnabled, limit, normalize, setDeadband, setExpiration, setMaxOutput, setSafetyEnabled`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KilloughDrive

          public KilloughDrive(SpeedController leftMotor,
                               SpeedController rightMotor,
                               SpeedController backMotor)

      Construct a Killough drive with the given motors and default motor angles.

      The default motor angles are 120, 60, and 270 degrees for the left, right, and back motors respectively, which make the wheels on each corner parallel to their respective opposite sides.

      If a motor needs to be inverted, do so before passing it in.

      Parameters:
        `leftMotor` - The motor on the left corner.
        `rightMotor` - The motor on the right corner.
        `backMotor` - The motor on the back corner.

    - #### KilloughDrive

          public KilloughDrive(SpeedController leftMotor,
                               SpeedController rightMotor,
                               SpeedController backMotor,
                               double leftMotorAngle,
                               double rightMotorAngle,
                               double backMotorAngle)

      Construct a Killough drive with the given motors.

      Angles are measured in counter-clockwise degrees where zero degrees is straight ahead.

      Parameters:
        `leftMotor` - The motor on the left corner.
        `rightMotor` - The motor on the right corner.
        `backMotor` - The motor on the back corner.
        `leftMotorAngle` - The angle of the left wheel's forward direction of travel.
        `rightMotorAngle` - The angle of the right wheel's forward direction of travel.
        `backMotorAngle` - The angle of the back wheel's forward direction of travel.

  - ### Method Detail

    - #### driveCartesian

          public void driveCartesian(double x,
                                     double y,
                                     double rotation)

      Drive method for Killough platform.
      Parameters:
        `x` - The speed that the robot should drive in the X direction. [-1.0..1.0]
        `y` - The speed that the robot should drive in the Y direction. [-1.0..1.0]
        `rotation` - The rate of rotation for the robot that is completely independent of the translation. [-1.0..1.0]

    - #### driveCartesian

          public void driveCartesian(double x,
                                     double y,
                                     double rotation,
                                     double gyroAngle)

      Drive method for Killough platform.
      Parameters:
        `x` - The speed that the robot should drive in the X direction. [-1.0..1.0]
        `y` - The speed that the robot should drive in the Y direction. [-1.0..1.0]
        `rotation` - The rate of rotation for the robot that is completely independent of the translation. [-1.0..1.0]
        `gyroAngle` - The current angle reading from the gyro. Use this to implement field-oriented controls.

    - #### drivePolar

          public void drivePolar(double magnitude,
                                 double angle,
                                 double rotation)

      Drive method for Killough platform.
      Parameters:
        `magnitude` - The speed that the robot should drive in a given direction. [-1.0..1.0]
        `angle` - The direction the robot should drive in degrees. 0.0 is straight ahead. The direction and maginitude are independent of the rotation rate.
        `rotation` - The rate of rotation for the robot that is completely independent of the magnitude or direction. [-1.0..1.0]

    - #### stopMotor

          public void stopMotor()

      Specified by:
        `stopMotor` in interface `MotorSafety`
      Specified by:
        `stopMotor` in class `RobotDriveBase`

    - #### getDescription

          public java.lang.String getDescription()

      Specified by:
        `getDescription` in interface `MotorSafety`
      Specified by:
        `getDescription` in class `RobotDriveBase`