Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 814628a

Browse files
committed
add JavaDocs to some commands and fix naming
for example, outake -> outtake, adding "Button" to button names, and ensuring they all start lowercase
1 parent 44b530b commit 814628a

5 files changed

Lines changed: 37 additions & 36 deletions

File tree

Robot2018/src/org/usfirst/frc/team199/Robot2018/OI.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.usfirst.frc.team199.Robot2018.commands.IntakeCube;
1212
import org.usfirst.frc.team199.Robot2018.commands.LowerIntake;
1313
import org.usfirst.frc.team199.Robot2018.commands.OpenIntake;
14-
import org.usfirst.frc.team199.Robot2018.commands.OutakeCube;
14+
import org.usfirst.frc.team199.Robot2018.commands.OuttakeCube;
1515
import org.usfirst.frc.team199.Robot2018.commands.PIDMove;
1616
import org.usfirst.frc.team199.Robot2018.commands.PIDTurn;
1717
import org.usfirst.frc.team199.Robot2018.commands.RaiseIntake;
@@ -41,21 +41,21 @@ public class OI {
4141
private JoystickButton shiftLowGearButton;
4242
private JoystickButton shiftHighGearButton;
4343
private JoystickButton shiftDriveTypeButton;
44-
private JoystickButton PIDMoveButton;
45-
private JoystickButton PIDTurnButton;
44+
private JoystickButton pIDMoveButton;
45+
private JoystickButton pIDTurnButton;
4646
private JoystickButton resetEncButton;
47-
private JoystickButton MoveLiftUpButton;
48-
private JoystickButton MoveLiftDownButton;
47+
private JoystickButton moveLiftUpButton;
48+
private JoystickButton moveLiftDownButton;
4949
public Joystick rightJoy;
5050
private JoystickButton updatePIDConstantsButton;
5151
private JoystickButton updateEncoderDPPButton;
5252
public Joystick manipulator;
53-
private JoystickButton closeIntake;
54-
private JoystickButton openIntake;
55-
private JoystickButton raiseIntake;
56-
private JoystickButton lowerIntake;
57-
private JoystickButton intake;
58-
private JoystickButton outake;
53+
private JoystickButton closeIntakeButton;
54+
private JoystickButton openIntakeButton;
55+
private JoystickButton raiseIntakeButton;
56+
private JoystickButton lowerIntakeButton;
57+
private JoystickButton intakeCubeButton;
58+
private JoystickButton outtakeCubeButton;
5959

6060
public int getButton(String key, int def) {
6161
if (!SmartDashboard.containsKey("Button/" + key)) {
@@ -71,13 +71,13 @@ public OI() {
7171
leftJoy = new Joystick(0);
7272
shiftDriveTypeButton = new JoystickButton(leftJoy, getButton("Shift Drive Type", 2));
7373
shiftDriveTypeButton.whenPressed(new ShiftDriveType());
74-
PIDMoveButton = new JoystickButton(leftJoy, getButton("PID Move", 7));
75-
PIDMoveButton
74+
pIDMoveButton = new JoystickButton(leftJoy, getButton("PID Move", 7));
75+
pIDMoveButton
7676
.whenPressed(new PIDMove(Robot.sd.getConst("Move Targ", 24), Robot.dt, Robot.sd, RobotMap.distEncAvg));
77-
PIDTurnButton = new JoystickButton(leftJoy, getButton("PID Turn", 8));
77+
pIDTurnButton = new JoystickButton(leftJoy, getButton("PID Turn", 8));
7878
// PIDTurnButton.whenPressed(new PIDTurn(Robot.getConst("Turn Targ", 90),
7979
// Robot.dt, Robot.sd RobotMap.fancyGyro));
80-
PIDTurnButton
80+
pIDTurnButton
8181
.whenReleased(new PIDTurn(Robot.getConst("Turn Targ", 90), Robot.dt, Robot.sd, RobotMap.fancyGyro));
8282
resetEncButton = new JoystickButton(leftJoy, getButton("Reset Dist Enc", 10));
8383
resetEncButton.whenPressed(new ResetEncoders());
@@ -91,23 +91,23 @@ public OI() {
9191
updatePIDConstantsButton.whenPressed(new UpdatePIDConstants());
9292
updateEncoderDPPButton = new JoystickButton(rightJoy, getButton("Get Encoder Dist Per Pulse", 9));
9393
updateEncoderDPPButton.whenPressed(new SetDistancePerPulse());
94-
MoveLiftUpButton = new JoystickButton(rightJoy, getButton("Run Lift Motor Up", 10));
95-
MoveLiftDownButton = new JoystickButton(rightJoy, getButton("Run Lift Motor Down", 11));
96-
MoveLiftUpButton.whileHeld(new RunLift(Robot.lift, true));
97-
MoveLiftDownButton.whileHeld(new RunLift(Robot.lift, false));
94+
moveLiftUpButton = new JoystickButton(rightJoy, getButton("Run Lift Motor Up", 10));
95+
moveLiftDownButton = new JoystickButton(rightJoy, getButton("Run Lift Motor Down", 11));
96+
moveLiftUpButton.whileHeld(new RunLift(Robot.lift, true));
97+
moveLiftDownButton.whileHeld(new RunLift(Robot.lift, false));
9898

9999
manipulator = new Joystick(2);
100-
closeIntake = new JoystickButton(manipulator, getButton("Close Intake Button", 1));
101-
closeIntake.whenPressed(new CloseIntake());
102-
openIntake = new JoystickButton(manipulator, getButton("Open Intake Button", 2));
103-
openIntake.whenPressed(new OpenIntake());
104-
raiseIntake = new JoystickButton(manipulator, getButton("Raise Intake Button", 3));
105-
raiseIntake.whenPressed(new RaiseIntake());
106-
lowerIntake = new JoystickButton(manipulator, getButton("Lower Intake Button", 4));
107-
lowerIntake.whenPressed(new LowerIntake());
108-
intake = new JoystickButton(manipulator, getButton("Intake Button", 5));
109-
intake.whenPressed(new IntakeCube());
110-
outake = new JoystickButton(manipulator, getButton("Outake Button", 6));
111-
outake.whenPressed(new OutakeCube());
100+
closeIntakeButton = new JoystickButton(manipulator, getButton("Close Intake Button", 1));
101+
closeIntakeButton.whenPressed(new CloseIntake());
102+
openIntakeButton = new JoystickButton(manipulator, getButton("Open Intake Button", 2));
103+
openIntakeButton.whenPressed(new OpenIntake());
104+
raiseIntakeButton = new JoystickButton(manipulator, getButton("Raise Intake Button", 3));
105+
raiseIntakeButton.whenPressed(new RaiseIntake());
106+
lowerIntakeButton = new JoystickButton(manipulator, getButton("Lower Intake Button", 4));
107+
lowerIntakeButton.whenPressed(new LowerIntake());
108+
intakeCubeButton = new JoystickButton(manipulator, getButton("Intake Button", 5));
109+
intakeCubeButton.whenPressed(new IntakeCube());
110+
outtakeCubeButton = new JoystickButton(manipulator, getButton("Outake Button", 6));
111+
outtakeCubeButton.whenPressed(new OuttakeCube());
112112
}
113113
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/OutakeCube.java renamed to Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/OuttakeCube.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
/**
99
*
1010
*/
11-
public class OutakeCube extends Command {
11+
public class OuttakeCube extends Command {
1212

1313
Timer tim;
1414

15-
public OutakeCube() {
15+
public OuttakeCube() {
1616
// Use requires() here to declare subsystem dependencies
1717
// eg. requires(chassis);
1818
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/ResetEncoders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import edu.wpi.first.wpilibj.command.InstantCommand;
66

77
/**
8-
*
8+
* Resets left and right drivetrain encoders to 0
99
*/
1010
public class ResetEncoders extends InstantCommand {
1111

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/SetDistancePerPulse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import edu.wpi.first.wpilibj.command.InstantCommand;
66

77
/**
8-
*
8+
* Sets distance per pulse for left and right drivetrain encoders from
9+
* SmartDashboard "Distance Per Pulse Left" & "Distance Per Pulse Right"
910
*/
1011
public class SetDistancePerPulse extends InstantCommand {
1112

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/UpdatePIDConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import edu.wpi.first.wpilibj.command.InstantCommand;
66

77
/**
8-
*
8+
* Updates the PIDControllers' PIDConstants based on SmartDashboard values
99
*/
1010
public class UpdatePIDConstants extends InstantCommand {
1111

0 commit comments

Comments
 (0)