mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[build] Bring naming checkstyle rules up to date with Google Style guide (#1781)
Also update Checkstyle to 8.38. Google changed their style guide from the last time we imported it. This PR brings in those naming changes. The change they made is allowing single letter member, parameter, and local variable names. They also added a lambda naming scheme and I thought it would be good to bring that in too.
This commit is contained in:
@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
|
||||
|
||||
private final DifferentialDrive m_myRobot
|
||||
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
|
||||
new PWMVictorSPX(kRightMotorPort));
|
||||
new PWMVictorSPX(kRightMotorPort));
|
||||
private final AnalogGyro m_gyro = new AnalogGyro(kGyroPort);
|
||||
private final Joystick m_joystick = new Joystick(kJoystickPort);
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ public final class Constants {
|
||||
|
||||
public static final MecanumDriveKinematics kDriveKinematics =
|
||||
new MecanumDriveKinematics(
|
||||
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
|
||||
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
|
||||
|
||||
public static final int kEncoderCPR = 1024;
|
||||
public static final double kWheelDiameterMeters = 0.15;
|
||||
|
||||
@@ -65,8 +65,8 @@ public class RobotContainer {
|
||||
// Example of how to use the onboard IO
|
||||
Button onboardButtonA = new Button(m_onboardIO::getButtonAPressed);
|
||||
onboardButtonA
|
||||
.whenActive(new PrintCommand("Button A Pressed"))
|
||||
.whenInactive(new PrintCommand("Button A Released"));
|
||||
.whenActive(new PrintCommand("Button A Pressed"))
|
||||
.whenInactive(new PrintCommand("Button A Released"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ public class SwerveModule {
|
||||
|
||||
private final ProfiledPIDController m_turningPIDController
|
||||
= new ProfiledPIDController(1, 0, 0,
|
||||
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration));
|
||||
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity,
|
||||
kModuleMaxAngularAcceleration));
|
||||
|
||||
// Gains are for example purposes only - must be determined for your own robot!
|
||||
private final SimpleMotorFeedforward m_driveFeedforward = new SimpleMotorFeedforward(1, 3);
|
||||
|
||||
@@ -55,10 +55,10 @@ public final class Constants {
|
||||
//Distance between front and back wheels on robot
|
||||
public static final SwerveDriveKinematics kDriveKinematics =
|
||||
new SwerveDriveKinematics(
|
||||
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
|
||||
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
|
||||
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
|
||||
|
||||
public static final boolean kGyroReversed = false;
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ public class SwerveModule {
|
||||
|
||||
private final ProfiledPIDController m_turningPIDController
|
||||
= new ProfiledPIDController(1, 0, 0,
|
||||
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration));
|
||||
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity,
|
||||
kModuleMaxAngularAcceleration));
|
||||
|
||||
// Gains are for example purposes only - must be determined for your own robot!
|
||||
private final SimpleMotorFeedforward m_driveFeedforward = new SimpleMotorFeedforward(1, 3);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Robot extends TimedRobot {
|
||||
private final AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
|
||||
private final DifferentialDrive m_robotDrive
|
||||
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
|
||||
new PWMVictorSPX(kRightMotorPort));
|
||||
new PWMVictorSPX(kRightMotorPort));
|
||||
|
||||
/**
|
||||
* Tells the robot to drive to a set distance (in inches) from an object
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Robot extends TimedRobot {
|
||||
private final AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
|
||||
private final DifferentialDrive m_robotDrive
|
||||
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
|
||||
new PWMVictorSPX(kRightMotorPort));
|
||||
new PWMVictorSPX(kRightMotorPort));
|
||||
private final PIDController m_pidController = new PIDController(kP, kI, kD);
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user