public class KilloughDrive extends RobotDriveBase
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.
RobotDriveBase.MotorType
m_deadband, m_maxOutput, m_safetyHelper
DEFAULT_SAFETY_EXPIRATION
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.
|
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() |
applyDeadband, getExpiration, isAlive, isSafetyEnabled, limit, normalize, setDeadband, setExpiration, setMaxOutput, setSafetyEnabled
public KilloughDrive(SpeedController leftMotor, SpeedController rightMotor, SpeedController backMotor)
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.
leftMotor
- The motor on the left corner.rightMotor
- The motor on the right corner.backMotor
- The motor on the back corner.public KilloughDrive(SpeedController leftMotor, SpeedController rightMotor, SpeedController backMotor, double leftMotorAngle, double rightMotorAngle, double backMotorAngle)
Angles are measured in counter-clockwise degrees where zero degrees is straight ahead.
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.public void driveCartesian(double x, double y, double rotation)
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]public void driveCartesian(double x, double y, double rotation, double gyroAngle)
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.public void drivePolar(double magnitude, double angle, double rotation)
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]public void stopMotor()
stopMotor
in interface MotorSafety
stopMotor
in class RobotDriveBase
public java.lang.String getDescription()
getDescription
in interface MotorSafety
getDescription
in class RobotDriveBase