projects
/
3501
/
stronghold-2016
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9e9154a
)
Moderately streamline imports of constants
author
Harel Dor
<hareldor@gmail.com>
Fri, 11 Mar 2016 23:57:40 +0000
(15:57 -0800)
committer
Harel Dor
<hareldor@gmail.com>
Fri, 11 Mar 2016 23:57:40 +0000
(15:57 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/OI.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArm.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/shooter/Shoot.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
patch
|
blob
|
blame
|
history
diff --git
a/src/org/usfirst/frc/team3501/robot/Constants.java
b/src/org/usfirst/frc/team3501/robot/Constants.java
index 38899ea422b1e068d0bc0171e16540fdbcf0a73e..2c7971dc262428c1f28bb8bf1e79d92f1397703e 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Constants.java
+++ b/
src/org/usfirst/frc/team3501/robot/Constants.java
@@
-82,8
+82,8
@@
public class Constants {
public static final int CATAPULT2_FORWARD = 0;
public static final int CATAPULT2_REVERSE = 1;
public static final int CATAPULT2_FORWARD = 0;
public static final int CATAPULT2_REVERSE = 1;
- public static final Value
shoot
= Value.kForward;
- public static final Value
reset
= Value.kReverse;
+ public static final Value
SHOOT
= Value.kForward;
+ public static final Value
RESET
= Value.kReverse;
public static final double WAIT_TIME = 2.0; // In seconds
}
public static final double WAIT_TIME = 2.0; // In seconds
}
diff --git
a/src/org/usfirst/frc/team3501/robot/OI.java
b/src/org/usfirst/frc/team3501/robot/OI.java
index 0acc3c8067067d572ee34a525ce9fad7f4115fdc..474ea9835237b8f5b01e3170890f05a536bd2a86 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/OI.java
+++ b/
src/org/usfirst/frc/team3501/robot/OI.java
@@
-1,5
+1,6
@@
package org.usfirst.frc.team3501.robot;
package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.Constants.IntakeArm;
import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear;
import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
import org.usfirst.frc.team3501.robot.commands.driving.ToggleFront;
import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear;
import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
import org.usfirst.frc.team3501.robot.commands.driving.ToggleFront;
@@
-44,19
+45,19
@@
public class OI {
extendIntake1 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_1_PORT);
extendIntake1 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_1_PORT);
- extendIntake1.whenPressed(new MoveIntakeArm(
Constants.
IntakeArm.EXTEND));
+ extendIntake1.whenPressed(new MoveIntakeArm(IntakeArm.EXTEND));
extendIntake2 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_2_PORT);
extendIntake2 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_2_PORT);
- extendIntake2.whenPressed(new MoveIntakeArm(
Constants.
IntakeArm.EXTEND));
+ extendIntake2.whenPressed(new MoveIntakeArm(IntakeArm.EXTEND));
retractIntake1 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_1_PORT);
retractIntake1 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_1_PORT);
- retractIntake1.whenPressed(new MoveIntakeArm(
Constants.
IntakeArm.RETRACT));
+ retractIntake1.whenPressed(new MoveIntakeArm(IntakeArm.RETRACT));
retractIntake2 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_2_PORT);
retractIntake2 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_2_PORT);
- retractIntake2.whenPressed(new MoveIntakeArm(
Constants.
IntakeArm.RETRACT));
+ retractIntake2.whenPressed(new MoveIntakeArm(IntakeArm.RETRACT));
toggleFront = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_TOGGLE_FRONT_PORT);
toggleFront = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_TOGGLE_FRONT_PORT);
@@
-65,18
+66,18
@@
public class OI {
// Right joystick
intake = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT);
// Right joystick
intake = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT);
- intake.whenPressed(new RunIntake(
Constants.
IntakeArm.IN));
- intake.whenReleased(new RunIntake(
Constants.
IntakeArm.STOP));
+ intake.whenPressed(new RunIntake(IntakeArm.IN));
+ intake.whenReleased(new RunIntake(IntakeArm.STOP));
outtake1 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT);
outtake1 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT);
- outtake1.whenPressed(new RunIntake(
Constants.
IntakeArm.OUT));
- outtake1.whenReleased(new RunIntake(
Constants.
IntakeArm.STOP));
+ outtake1.whenPressed(new RunIntake(IntakeArm.OUT));
+ outtake1.whenReleased(new RunIntake(IntakeArm.STOP));
outtake2 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT);
outtake2 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT);
- outtake2.whenPressed(new RunIntake(
Constants.
IntakeArm.OUT));
- outtake2.whenReleased(new RunIntake(
Constants.
IntakeArm.STOP));
+ outtake2.whenPressed(new RunIntake(IntakeArm.OUT));
+ outtake2.whenReleased(new RunIntake(IntakeArm.STOP));
shooterUp = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT);
shooterUp = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT);
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArm.java
b/src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArm.java
index 1991726ac0430491e27144202c7e544599ab4f7c..b90b83e0723621f717eb8a84dc64f33e7043440a 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArm.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArm.java
@@
-1,6
+1,6
@@
package org.usfirst.frc.team3501.robot.commands.intakearm;
package org.usfirst.frc.team3501.robot.commands.intakearm;
-import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Constants
.IntakeArm
;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
@@
-20,7
+20,7
@@
public class MoveIntakeArm extends Command {
@Override
protected void initialize() {
@Override
protected void initialize() {
- if (direction ==
Constants.
IntakeArm.EXTEND)
+ if (direction == IntakeArm.EXTEND)
Robot.intakeArm.extendPistons();
else
Robot.intakeArm.retractPistons();
Robot.intakeArm.extendPistons();
else
Robot.intakeArm.retractPistons();
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
index c69b350631e777c30fa65a792f8d1a2928092f18..7d2e490a00eda1b196cfdc8fdf871285e7556c00 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
@@
-1,6
+1,6
@@
package org.usfirst.frc.team3501.robot.commands.intakearm;
package org.usfirst.frc.team3501.robot.commands.intakearm;
-import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Constants
.IntakeArm
;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
@@
-15,9
+15,9
@@
public class RunIntake extends Command {
@Override
protected void initialize() {
@Override
protected void initialize() {
- if (direction ==
Constants.
IntakeArm.IN)
+ if (direction == IntakeArm.IN)
Robot.intakeArm.intakeBall();
Robot.intakeArm.intakeBall();
- else if (direction ==
Constants.
IntakeArm.OUT)
+ else if (direction == IntakeArm.OUT)
Robot.intakeArm.outputBall();
else
Robot.intakeArm.stopRollers();
Robot.intakeArm.outputBall();
else
Robot.intakeArm.stopRollers();
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/shooter/Shoot.java
b/src/org/usfirst/frc/team3501/robot/commands/shooter/Shoot.java
index f0416b4eb11a64f34258dabc3ff5f9dd389c861e..498309c0d7e5a67f6a32ee342d8f27adb4169d61 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/commands/shooter/Shoot.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/shooter/Shoot.java
@@
-1,14
+1,12
@@
package org.usfirst.frc.team3501.robot.commands.shooter;
package org.usfirst.frc.team3501.robot.commands.shooter;
-import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Constants
.Shooter
;
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.WaitCommand;
public class Shoot extends CommandGroup {
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.WaitCommand;
public class Shoot extends CommandGroup {
- public boolean usePhotogate;
-
/**
* Fires catapult, then resets after a pause. If robot is set to use photogate
* and no ball is detected, nothing happens.
/**
* Fires catapult, then resets after a pause. If robot is set to use photogate
* and no ball is detected, nothing happens.
@@
-18,7
+16,7
@@
public class Shoot extends CommandGroup {
*/
public Shoot() {
addSequential(new FireCatapult());
*/
public Shoot() {
addSequential(new FireCatapult());
- addSequential(new WaitCommand(
Constants.
Shooter.WAIT_TIME));
+ addSequential(new WaitCommand(Shooter.WAIT_TIME));
addSequential(new ResetCatapult());
}
}
addSequential(new ResetCatapult());
}
}
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java
b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java
index fab91f6eaea1a56a493dfd800ac9dc5e040d4146..c9c29dd27ec45e88047e5c97697df44aa92070aa 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java
@@
-28,10
+28,12
@@
public class IntakeArm extends Subsystem {
intakeRoller = new CANTalon(Constants.IntakeArm.INTAKE_ROLLER_PORT);
leftIntake = new DoubleSolenoid(Constants.IntakeArm.LEFT_INTAKE_MODULE,
intakeRoller = new CANTalon(Constants.IntakeArm.INTAKE_ROLLER_PORT);
leftIntake = new DoubleSolenoid(Constants.IntakeArm.LEFT_INTAKE_MODULE,
- Constants.IntakeArm.LEFT_INTAKE_FORWARD, Constants.IntakeArm.LEFT_INTAKE_REVERSE);
+ Constants.IntakeArm.LEFT_INTAKE_FORWARD,
+ Constants.IntakeArm.LEFT_INTAKE_REVERSE);
rightIntake = new DoubleSolenoid(Constants.IntakeArm.RIGHT_INTAKE_MODULE,
rightIntake = new DoubleSolenoid(Constants.IntakeArm.RIGHT_INTAKE_MODULE,
- Constants.IntakeArm.RIGHT_INTAKE_FORWARD, Constants.IntakeArm.RIGHT_INTAKE_REVERSE);
+ Constants.IntakeArm.RIGHT_INTAKE_FORWARD,
+ Constants.IntakeArm.RIGHT_INTAKE_REVERSE);
}
public void retractPistons() {
}
public void retractPistons() {
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
index c613d7bb3abac19cee35dcf4f2969319de71d1e3..95d69af9358eb7f59041255c0a993272400ddb38 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
@@
-29,13
+29,13
@@
public class Shooter extends Subsystem {
// Catapult Commands
public void fireCatapult() {
// Catapult Commands
public void fireCatapult() {
- catapult1.set(Constants.Shooter.
shoot
);
- catapult2.set(Constants.Shooter.
shoot
);
+ catapult1.set(Constants.Shooter.
SHOOT
);
+ catapult2.set(Constants.Shooter.
SHOOT
);
}
public void resetCatapult() {
}
public void resetCatapult() {
- catapult1.set(Constants.Shooter.
reset
);
- catapult2.set(Constants.Shooter.
reset
);
+ catapult1.set(Constants.Shooter.
RESET
);
+ catapult2.set(Constants.Shooter.
RESET
);
}
@Override
}
@Override