mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Rename MotorType constants to all caps
This commit is contained in:
@@ -278,18 +278,18 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
var input = new Translation2d(xVelocity, yVelocity).rotateBy(gyroAngle.unaryMinus());
|
||||
|
||||
double[] wheelVelocities = new double[4];
|
||||
wheelVelocities[MotorType.kFrontLeft.value] = input.getX() + input.getY() + zRotation;
|
||||
wheelVelocities[MotorType.kFrontRight.value] = input.getX() - input.getY() - zRotation;
|
||||
wheelVelocities[MotorType.kRearLeft.value] = input.getX() - input.getY() + zRotation;
|
||||
wheelVelocities[MotorType.kRearRight.value] = input.getX() + input.getY() - zRotation;
|
||||
wheelVelocities[MotorType.FRONT_LEFT.value] = input.getX() + input.getY() + zRotation;
|
||||
wheelVelocities[MotorType.FRONT_RIGHT.value] = input.getX() - input.getY() - zRotation;
|
||||
wheelVelocities[MotorType.REAR_LEFT.value] = input.getX() - input.getY() + zRotation;
|
||||
wheelVelocities[MotorType.REAR_RIGHT.value] = input.getX() + input.getY() - zRotation;
|
||||
|
||||
normalize(wheelVelocities);
|
||||
|
||||
return new WheelVelocities(
|
||||
wheelVelocities[MotorType.kFrontLeft.value],
|
||||
wheelVelocities[MotorType.kFrontRight.value],
|
||||
wheelVelocities[MotorType.kRearLeft.value],
|
||||
wheelVelocities[MotorType.kRearRight.value]);
|
||||
wheelVelocities[MotorType.FRONT_LEFT.value],
|
||||
wheelVelocities[MotorType.FRONT_RIGHT.value],
|
||||
wheelVelocities[MotorType.REAR_LEFT.value],
|
||||
wheelVelocities[MotorType.REAR_RIGHT.value]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,19 +27,19 @@ public abstract class RobotDriveBase extends MotorSafety {
|
||||
/** The location of a motor on the robot for the purpose of driving. */
|
||||
public enum MotorType {
|
||||
/** Front left motor. */
|
||||
kFrontLeft(0),
|
||||
FRONT_LEFT(0),
|
||||
/** Front right motor. */
|
||||
kFrontRight(1),
|
||||
FRONT_RIGHT(1),
|
||||
/** Rear left motor. */
|
||||
kRearLeft(2),
|
||||
REAR_LEFT(2),
|
||||
/** Rear right motor. */
|
||||
kRearRight(3),
|
||||
REAR_RIGHT(3),
|
||||
/** Left motor. */
|
||||
kLeft(0),
|
||||
LEFT(0),
|
||||
/** Right motor. */
|
||||
kRight(1),
|
||||
RIGHT(1),
|
||||
/** Back motor. */
|
||||
kBack(2);
|
||||
BACK(2);
|
||||
|
||||
/** MotorType value. */
|
||||
public final int value;
|
||||
|
||||
Reference in New Issue
Block a user