From d59e512bf7c76078cc70224dbeb47fd43c388052 Mon Sep 17 00:00:00 2001 From: twof Date: Wed, 8 Oct 2014 17:55:44 -0700 Subject: [PATCH 1/6] Added note to code pulling instructions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hope it’s helpful for first timers. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4904484..6b9aa5c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ cd .. mv FRC-2014 2014 + NOTE: If you recieve errors when trying "git clone git@github.com:frc604/FRC-2014.git" [read this][5] + 6. Go to Netbeans and create a new "Simple Robot Template" project with the following settings: @@ -51,4 +53,4 @@ If you have any questions, talked to [Michael][4]. [2]: http://wpilib.screenstepslive.com/s/3120/m/7885/l/79407-configuring-the-netbeans-installation [3]: http://git-scm.com/ [4]: mailto:mdsmtp@gmail.com - +[5]: https://help.github.com/articles/generating-ssh-keys/ From e9c78b07319d8123837e99d26cde0378feb96601 Mon Sep 17 00:00:00 2001 From: twof Date: Wed, 8 Oct 2014 17:58:20 -0700 Subject: [PATCH 2/6] formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b9aa5c..20a9285 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ cd .. mv FRC-2014 2014 - NOTE: If you recieve errors when trying "git clone git@github.com:frc604/FRC-2014.git" [read this][5] +NOTE: If you recieve errors when trying "git clone git@github.com:frc604/FRC-2014.git" [read this][5] 6. Go to Netbeans and create a new "Simple Robot Template" project with the following settings: From 762c8d0b2042b7bbd01b9d2ad28d5d16f26127a8 Mon Sep 17 00:00:00 2001 From: twof Date: Wed, 8 Oct 2014 21:28:22 -0700 Subject: [PATCH 3/6] commenting --- README.md | 2 +- .../robot2014/modes/AutonomousMode.java | 10 +++--- .../_604robotics/robot2014/modules/Drive.java | 36 +++++++++---------- .../robot2014/modules/Shooter.java | 36 +++++++++---------- .../robot2014/modules/Vision.java | 18 +++++----- 5 files changed, 51 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 20a9285..7411afd 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,4 @@ If you have any questions, talked to [Michael][4]. [2]: http://wpilib.screenstepslive.com/s/3120/m/7885/l/79407-configuring-the-netbeans-installation [3]: http://git-scm.com/ [4]: mailto:mdsmtp@gmail.com -[5]: https://help.github.com/articles/generating-ssh-keys/ +[5]: https://help.github.com/articles/generating-ssh-keys/ \ No newline at end of file diff --git a/src/com/_604robotics/robot2014/modes/AutonomousMode.java b/src/com/_604robotics/robot2014/modes/AutonomousMode.java index 20a2f9b..a9e3859 100644 --- a/src/com/_604robotics/robot2014/modes/AutonomousMode.java +++ b/src/com/_604robotics/robot2014/modes/AutonomousMode.java @@ -14,12 +14,12 @@ public class AutonomousMode extends Procedure { public AutonomousMode () { super(new Coordinator() { protected void apply (ModuleManager modules) { - this.bind(new Binding(modules.getModule("Shifter").getAction("Low Gear"))); + this.bind(new Binding(modules.getModule("Shifter").getAction("Low Gear"))); //set the shifter into low gear - this.bind(new Binding(modules.getModule("Shooter").getAction("Retract"))); + this.bind(new Binding(modules.getModule("Shooter").getAction("Retract"))); //retract the shooter this.bind(new Binding(modules.getModule("Intake").getAction("On"), new TriggerAnd(new TriggerAccess[] { modules.getModule("Shooter").getTrigger("Charged"), - modules.getModule("Shooter").getTrigger("Deployed").not() + modules.getModule("Shooter").getTrigger("Deployed").not()//turn intake on if shooter is charged and not deployed }))); } }); @@ -34,12 +34,12 @@ protected void apply (ModuleManager modules) { })); add("Align", new Step(new TriggerMeasure(new TriggerAnd(new TriggerAccess[] { - modules.getModule("Drive").getTrigger("At Servo Target"), + modules.getModule("Drive").getTrigger("At Servo Target"), //when the servo is at target and the shooter is charged modules.getModule("Shooter").getTrigger("Charged") })), new Coordinator() { protected void apply (ModuleManager modules) { this.bind(new Binding(modules.getModule("Drive").getAction("Servo"))); - this.fill(new DataWire(modules.getModule("Drive").getAction("Servo"), "clicks", 1663)); + this.fill(new DataWire(modules.getModule("Drive").getAction("Servo"), "clicks", 1663)); //drive forwards 1663 clicks } })); diff --git a/src/com/_604robotics/robot2014/modules/Drive.java b/src/com/_604robotics/robot2014/modules/Drive.java index 3c14e5e..b560379 100644 --- a/src/com/_604robotics/robot2014/modules/Drive.java +++ b/src/com/_604robotics/robot2014/modules/Drive.java @@ -18,14 +18,14 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; public class Drive extends Module { - private final RobotDrive drive = new RobotDrive(2, 1); + private final RobotDrive drive = new RobotDrive(2, 1); //left, right motors on ports 2,1 - private final Encoder leftEncoder = new Encoder(2, 1); - private final Encoder rightEncoder = new Encoder(3, 4); + private final Encoder leftEncoder = new Encoder(2, 1); //left encoder on channels 2,1 + private final Encoder rightEncoder = new Encoder(3, 4); //right encoder on channels 3,4 private final PIDController pid = new PIDController(0.005, 0D, 0.005, leftEncoder, new PIDOutput () { public void pidWrite (double output) { - drive.setLeftRightMotorOutputs(output, output); + drive.setLeftRightMotorOutputs(output, output); //set the speed of the left and right motors } }); @@ -36,7 +36,7 @@ public Drive () { leftEncoder.start(); rightEncoder.start(); - pid.setAbsoluteTolerance(25); + pid.setAbsoluteTolerance(25); //set the error range for which onTarget can still return true SmartDashboard.putData("Drive PID", pid); this.set(new DataMap() {{ @@ -66,12 +66,12 @@ public double run () { }}); this.set(new TriggerMap() {{ - add("At Servo Target", new Trigger() { + add("At Servo Target", new Trigger() { //I wanna say this will run the servo for .5 seconds. private final Timer timer = new Timer(); private boolean timing = false; public boolean run () { - if (pid.isEnable() && pid.onTarget()) { + if (pid.isEnable() && pid.onTarget()) { //if the pid controller is on and is on within the tolerance if (!timing) { timing = true; timer.start(); @@ -95,20 +95,20 @@ public boolean run () { this.set(new ElasticController() {{ addDefault("Off", new Action() { public void run (ActionData data) { - drive.tankDrive(0D, 0D); + drive.tankDrive(0D, 0D); //leftstick and right stick values. not sure what that means exactly. } }); add("Arcade Drive", new Action(new FieldMap () {{ - define("throttle", 0D); - define("turn", 0D); + define("throttle", 0D); //the throttle stick value + define("turn", 0D); //the turn stick value }}) { public void run (ActionData data) { - drive.arcadeDrive(data.get("throttle"), data.get("turn")); + drive.arcadeDrive(data.get("throttle"), data.get("turn")); //sets the throttle and turn stick values } public void end (ActionData data) { - drive.stopMotor(); + drive.stopMotor(); //stops the motor I suppose } }); @@ -125,7 +125,7 @@ public void end (ActionData data) { } }); - add("Stick Drive", new Action(new FieldMap () {{ + add("Stick Drive", new Action(new FieldMap () {{ // I'm almost completely sure this is exaclty the same as arcade drive but I could be wrong define("throttle", 0D); define("turn", 0D); }}) { @@ -142,22 +142,22 @@ public void end (ActionData data) { define("clicks", 0D); }}) { public void begin (ActionData data) { - pid.setSetpoint(data.get("clicks") + data.data("Left Drive Clicks")); - pid.enable(); + pid.setSetpoint(data.get("clicks") + data.data("Left Drive Clicks")); //set the clicks and the clicks to the desired value? + pid.enable(); //start running the pid controller } public void end (ActionData data) { - pid.reset(); + pid.reset(); //Reset the previous error, the integral term, and disable the controller } }); add("Forward", new Action() { public void run (ActionData data) { - drive.setLeftRightMotorOutputs(1.0, 1.0); + drive.setLeftRightMotorOutputs(1.0, 1.0); // the speeds of the left an right motor become 1 } public void end (ActionData data) { - drive.stopMotor(); + drive.stopMotor(); //stops the motor } }); }}); diff --git a/src/com/_604robotics/robot2014/modules/Shooter.java b/src/com/_604robotics/robot2014/modules/Shooter.java index 6e3d5f9..45bc03c 100644 --- a/src/com/_604robotics/robot2014/modules/Shooter.java +++ b/src/com/_604robotics/robot2014/modules/Shooter.java @@ -13,23 +13,23 @@ import edu.wpi.first.wpilibj.Victor; public class Shooter extends Module { - private final Solenoid release = new Solenoid(6); - private final Victor winch = new Victor(4); - private final DigitalInput limitSwitch = new DigitalInput(7); + private final Solenoid release = new Solenoid(6); //new solenoid on channel 6 + private final Victor winch = new Victor(4); //new victor on channel 4 + private final DigitalInput limitSwitch = new DigitalInput(7); //new limit switch on channel 7 private final Timer deployTimer = new Timer(); public Shooter () { this.set(new TriggerMap() {{ - add("Charged", new Trigger() { + add("Charged", new Trigger() { //checks to see if shooter is charged. Returns. public boolean run() { - return !limitSwitch.get(); + return !limitSwitch.get(); //if limitSwitch is not flipped. return that shooter is charged. } }); - add("Deployed", new Trigger() { + add("Deployed", new Trigger() { //checks to see if shooter is deployed. Returns. public boolean run() { - return deployTimer.get() > 1; + return deployTimer.get() > 1; //if deploy timer is greater than 1, return that shooter is deployed } }); }}); @@ -37,45 +37,45 @@ public boolean run() { this.set(new ElasticController () {{ addDefault("Idle", new Action() { public void begin(ActionData data) { - release.set(false); + release.set(false); //solenoid off } public void run(ActionData data) { - winch.stopMotor(); + winch.stopMotor(); //stop the victor winch } }); add("Retract", new Action() { public void begin (ActionData data) { - release.set(false); + release.set(false); //solenoid off } public void run (ActionData data) { - release.set(false); - if (limitSwitch.get()) - winch.set(-1D); + release.set(false); //solenoid off + if (limitSwitch.get()) //if limit switch is on + winch.set(-1D); //start the winch? else - winch.stopMotor(); + winch.stopMotor(); //stop the winch } public void end (ActionData data) { - winch.stopMotor(); + winch.stopMotor(); //stop the winch } }); add("Deploy", new Action() { public void begin (ActionData data) { - release.set(true); + release.set(true); //solenoid on deployTimer.start(); } public void run (ActionData data) { - winch.stopMotor(); + winch.stopMotor(); //stop the winch } public void end (ActionData data) { - release.set(false); + release.set(false); //solenoid off deployTimer.stop(); deployTimer.reset(); diff --git a/src/com/_604robotics/robot2014/modules/Vision.java b/src/com/_604robotics/robot2014/modules/Vision.java index cac7d0c..b46080c 100644 --- a/src/com/_604robotics/robot2014/modules/Vision.java +++ b/src/com/_604robotics/robot2014/modules/Vision.java @@ -28,31 +28,31 @@ public Vision () { add("Snapped", new Trigger() { public boolean run () { - return state > SNAPPING; + return state > SNAPPING; //if the state is greater than 0, is snapped } }); add("Ready", new Trigger() { public boolean run () { - return state >= READY; + return state >= READY; //if the state is greater or equal to 2, is ready } }); }}); this.set(new ElasticController() {{ - addDefault("Idle"); + addDefault("Idle"); //nothing doing anything by default add("Snap", new Action() { private final Timer timer = new Timer(); public void begin (ActionData data) { - state = SNAPPING; - timer.start(); + state = SNAPPING; //set the state to snapping + timer.start(); //start the timer } public void run (ActionData data) { - if (timer.get() > 1.5) { - state = PAUSING; + if (timer.get() > 1.5) { //if 1.5 miliseconds have passed + state = PAUSING; //the state is to be set to pausing } else { leftTarget = data.trigger("Left Target"); rightTarget = data.trigger("Right Target"); @@ -60,8 +60,8 @@ public void run (ActionData data) { } public void end (ActionData data) { - timer.stop(); - timer.reset(); + timer.stop(); //stop the timer + timer.reset(); //reset it to 0 } }); From 6936cd93dc3b83e5b1b596de540ababd82626eb9 Mon Sep 17 00:00:00 2001 From: twof Date: Wed, 8 Oct 2014 22:19:45 -0700 Subject: [PATCH 4/6] comments --- .../robot2014/modes/AutonomousMode.java | 10 ++--- .../robot2014/modules/Flower.java | 38 +++++++++---------- .../robot2014/modules/Intake.java | 6 +-- .../robot2014/modules/Rotation.java | 6 +-- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/com/_604robotics/robot2014/modes/AutonomousMode.java b/src/com/_604robotics/robot2014/modes/AutonomousMode.java index a9e3859..036e224 100644 --- a/src/com/_604robotics/robot2014/modes/AutonomousMode.java +++ b/src/com/_604robotics/robot2014/modes/AutonomousMode.java @@ -45,15 +45,15 @@ protected void apply (ModuleManager modules) { add("Pause", new Step(new TriggerMeasure(modules.getModule("Vision").getTrigger("Ready")), new Coordinator() { protected void apply (ModuleManager modules) { - this.bind(new Binding(modules.getModule("Vision").getAction("Pause"))); - this.bind(new Binding(modules.getModule("Flower").getAction("Shoot"))); - this.bind(new Binding(modules.getModule("Rotation").getAction("Manual Angle"))); + this.bind(new Binding(modules.getModule("Vision").getAction("Pause"))); //pause vision + this.bind(new Binding(modules.getModule("Flower").getAction("Shoot"))); //put flower into the shoot position + this.bind(new Binding(modules.getModule("Rotation").getAction("Manual Angle"))); //I can't figure out how rotation works at all. Ask Michael about this. } })); add("Aim", new Step(new TriggerMeasure(new TriggerAnd(new TriggerAccess[] { modules.getModule("Rotation").getTrigger("At Angle Target"), - modules.getModule("Flower").getTrigger("Travelling").not() + modules.getModule("Flower").getTrigger("Travelling").not() //while the flower isn't traveling })), new Coordinator() { protected void apply (ModuleManager modules) { this.bind(new Binding(modules.getModule("Rotation").getAction("Manual Angle"))); @@ -63,7 +63,7 @@ protected void apply (ModuleManager modules) { add("Shoot", new Step(new Coordinator() { protected void apply (ModuleManager modules) { this.bind(new Binding(modules.getModule("Rotation").getAction("Manual Angle"))); - this.bind(new Binding(modules.getModule("Shooter").getAction("Deploy"), true)); + this.bind(new Binding(modules.getModule("Shooter").getAction("Deploy"), true)); //fire the ball } })); } diff --git a/src/com/_604robotics/robot2014/modules/Flower.java b/src/com/_604robotics/robot2014/modules/Flower.java index a559cd0..c4b4950 100644 --- a/src/com/_604robotics/robot2014/modules/Flower.java +++ b/src/com/_604robotics/robot2014/modules/Flower.java @@ -10,9 +10,9 @@ import edu.wpi.first.wpilibj.Timer; public class Flower extends Module { - private final Solenoid top = new Solenoid(4); - private final Solenoid sides = new Solenoid(5); - private final Solenoid bottom = new Solenoid(3); + private final Solenoid top = new Solenoid(4); //top solenoid in channel 4 + private final Solenoid sides = new Solenoid(5); //side solenoids in channel 5 + private final Solenoid bottom = new Solenoid(3); //bottom solenoid in channel 3 private final Timer travelTimer = new Timer(); @@ -20,7 +20,7 @@ public Flower () { this.set(new TriggerMap() {{ add("Travelling", new Trigger() { public boolean run () { - return travelTimer.get() < 0.6; + return travelTimer.get() < 0.6; //petals always travel for at least .6 seconds } }); }}); @@ -28,9 +28,9 @@ public boolean run () { this.set(new StateController () {{ addDefault("Close", new Action() { public void begin (ActionData data) { - top.set(false); - sides.set(false); - bottom.set(false); + top.set(false); //for the closed polition, the top petal is closed + sides.set(false); //the sides are closed + bottom.set(false); //the bottom is closed travelTimer.reset(); } @@ -38,9 +38,9 @@ public void begin (ActionData data) { add("Open", new Action() { public void begin (ActionData data) { - top.set(true); - sides.set(true); - bottom.set(true); + top.set(true); //for the open position, the top petal is open + sides.set(true); //the sides are open + bottom.set(true); //and the bottom is open travelTimer.reset(); } @@ -48,9 +48,9 @@ public void begin (ActionData data) { add("Pickup", new Action() { public void begin (ActionData data) { - top.set(false); - sides.set(false); - bottom.set(false); + top.set(false); //for the pickup position, the top is closed + sides.set(false); //the sides are closed + bottom.set(false); //and the bottom is closed travelTimer.reset(); } @@ -58,9 +58,9 @@ public void begin (ActionData data) { add("Drop", new Action() { public void begin (ActionData data) { - top.set(true); - sides.set(true); - bottom.set(false); + top.set(true); //for the dropping position, the top petal is open + sides.set(true); //the sides are opened + bottom.set(false); //and the bottom is closed travelTimer.reset(); } @@ -68,9 +68,9 @@ public void begin (ActionData data) { add("Shoot", new Action() { public void begin (ActionData data) { - top.set(true); - sides.set(false); - bottom.set(false); + top.set(true); //for the shooting position, the top petal is open + sides.set(false); //the sides are closed + bottom.set(false); //and the bottom is closed travelTimer.reset(); } diff --git a/src/com/_604robotics/robot2014/modules/Intake.java b/src/com/_604robotics/robot2014/modules/Intake.java index 2ecb346..2a42bdb 100644 --- a/src/com/_604robotics/robot2014/modules/Intake.java +++ b/src/com/_604robotics/robot2014/modules/Intake.java @@ -7,18 +7,18 @@ import edu.wpi.first.wpilibj.Victor; public class Intake extends Module { - private final Victor motor = new Victor(5); + private final Victor motor = new Victor(5); //adds intake victor to channel 5 public Intake() { this.set(new ElasticController() {{ addDefault("Off", new Action() { - public void run(ActionData data) { + public void run(ActionData data) { //stops intake motor.stopMotor(); } }); add("On", new Action() { - public void run(ActionData data) { + public void run(ActionData data) { //runs the intake motor.set(-1D); } diff --git a/src/com/_604robotics/robot2014/modules/Rotation.java b/src/com/_604robotics/robot2014/modules/Rotation.java index ac4d875..923ce85 100644 --- a/src/com/_604robotics/robot2014/modules/Rotation.java +++ b/src/com/_604robotics/robot2014/modules/Rotation.java @@ -16,10 +16,10 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; public class Rotation extends Module { - private final MA3A10 encoder = new MA3A10(1, 1); - private final Victor motor = new Victor(3); + private final MA3A10 encoder = new MA3A10(1, 1); //I have no idea what this device is. Something tossed on the rotation mechanism if I were to guess. + private final Victor motor = new Victor(3); //new victor in channel 3 - private final AntiWindupPIDController pid = new AntiWindupPIDController(-0.025, 0, Double.MAX_VALUE, 1, -0.025, encoder, motor); + private final AntiWindupPIDController pid = new AntiWindupPIDController(-0.025, 0, Double.MAX_VALUE, 1, -0.025, encoder/*input*/, motor/*output*/); private double baseAngle = 185D; From 6ae730aa2dde760c4dafd10409ad1666d594a101 Mon Sep 17 00:00:00 2001 From: twof Date: Thu, 9 Oct 2014 15:08:19 -0700 Subject: [PATCH 5/6] updated netbeans labels --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7411afd..11ab9c7 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ NOTE: If you recieve errors when trying "git clone git@github.com:frc604/FRC-201 | Field | Value | | ---------------- | -------------------------- | | Project Name | FRC-2014 | - | Package | com._604robotics.robot2014 | - | Main Robot Class | Robot2014 | + | Project Package | com._604robotics.robot2014 | + | Robot Class | Robot2014 | If you get strange errors starting up the code after a deploy, it's because you messed these settings up! From 9d1b6285f0dbf8f23a30cf42f9600b95d9048833 Mon Sep 17 00:00:00 2001 From: twof Date: Fri, 17 Oct 2014 16:31:32 -0700 Subject: [PATCH 6/6] comments --- src/com/_604robotics/robot2014/Robot2014.java | 2 +- src/com/_604robotics/robot2014/modules/Dashboard.java | 2 +- src/com/_604robotics/robot2014/modules/Intake.java | 2 +- src/com/_604robotics/robot2014/modules/Regulator.java | 9 +++++---- src/com/_604robotics/robot2014/modules/Rotation.java | 9 +++++---- src/com/_604robotics/robot2014/modules/Shifter.java | 8 +++++--- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/com/_604robotics/robot2014/Robot2014.java b/src/com/_604robotics/robot2014/Robot2014.java index 1e8f8bf..7b82dd3 100644 --- a/src/com/_604robotics/robot2014/Robot2014.java +++ b/src/com/_604robotics/robot2014/Robot2014.java @@ -20,7 +20,7 @@ public class Robot2014 extends Robot { public Robot2014 () { - this.set(new ModuleMap() {{ + this.set(new ModuleMap() {{ //adds each module to a hashtable named moduleTable. Not sure what a hashtable is exactly. Figure this out. add("Dashboard", new Dashboard()); add("Vision", new Vision()); add("Drive", new Drive()); diff --git a/src/com/_604robotics/robot2014/modules/Dashboard.java b/src/com/_604robotics/robot2014/modules/Dashboard.java index 50b4455..b8c8c64 100644 --- a/src/com/_604robotics/robot2014/modules/Dashboard.java +++ b/src/com/_604robotics/robot2014/modules/Dashboard.java @@ -9,7 +9,7 @@ public class Dashboard extends Module { public Dashboard () { this.set(new DataMap() {{ - add("Manual Angle", new DashboardData("Manual Angle", -50D)); + add("Manual Angle", new DashboardData("Manual Angle", -50D)); //sets up the angles for each rotation position add("Stow Angle" , new DashboardData("Stow Angle", 0D)); add("Shoot Angle" , new DashboardData("Shoot Angle", -50D)); diff --git a/src/com/_604robotics/robot2014/modules/Intake.java b/src/com/_604robotics/robot2014/modules/Intake.java index 2a42bdb..3b427c6 100644 --- a/src/com/_604robotics/robot2014/modules/Intake.java +++ b/src/com/_604robotics/robot2014/modules/Intake.java @@ -22,7 +22,7 @@ public void run(ActionData data) { //runs the intake motor.set(-1D); } - public void end(ActionData data) { + public void end(ActionData data) { //stops the intake motor.stopMotor(); } }); diff --git a/src/com/_604robotics/robot2014/modules/Regulator.java b/src/com/_604robotics/robot2014/modules/Regulator.java index 8fc202e..a627fb0 100644 --- a/src/com/_604robotics/robot2014/modules/Regulator.java +++ b/src/com/_604robotics/robot2014/modules/Regulator.java @@ -8,25 +8,26 @@ import com._604robotics.robotnik.trigger.TriggerMap; import edu.wpi.first.wpilibj.Compressor; +/*controls the compressor for pneumatics*/ public class Regulator extends Module { - private final Compressor compressor = new Compressor(5, 1); + private final Compressor compressor = new Compressor(5/*pressure switch channel*/, 1/*compressor Relay Channel*/); public Regulator () { this.set(new TriggerMap() {{ add("Charged", new Trigger() { public boolean run () { - return compressor.getPressureSwitchValue(); + return compressor.getPressureSwitchValue(); //how much pressure } }); }}); this.set(new ElasticController() {{ addDefault("On", new Action() { - public void begin (ActionData data) { + public void begin (ActionData data) { //starts the compressor compressor.start(); } - public void end (ActionData data) { + public void end (ActionData data) { //stops the compressor compressor.stop(); } }); diff --git a/src/com/_604robotics/robot2014/modules/Rotation.java b/src/com/_604robotics/robot2014/modules/Rotation.java index 923ce85..9514430 100644 --- a/src/com/_604robotics/robot2014/modules/Rotation.java +++ b/src/com/_604robotics/robot2014/modules/Rotation.java @@ -91,11 +91,12 @@ public void end (ActionData data) { } }); - add("Manual Angle", new AngleAction()); + //All of this is set in the Dashboard module? But it's not imported. I have no idea man. + add("Manual Angle", new AngleAction()); //Manual angle is set to -50D - add("Stow", new AngleAction()); - add("Shoot", new AngleAction()); - add("Ground", new AngleAction()); + add("Stow", new AngleAction()); //Stow angle is set to 0D + add("Shoot", new AngleAction()); //Shoot angle is set to -50D + add("Ground", new AngleAction()); //Ground angle is set to -108D add("Hold", new Action() { public void begin (ActionData data) { diff --git a/src/com/_604robotics/robot2014/modules/Shifter.java b/src/com/_604robotics/robot2014/modules/Shifter.java index e41742a..3411555 100644 --- a/src/com/_604robotics/robot2014/modules/Shifter.java +++ b/src/com/_604robotics/robot2014/modules/Shifter.java @@ -7,20 +7,22 @@ import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; + + public class Shifter extends Module { - private final DoubleSolenoid solenoid = new DoubleSolenoid(1, 2); + private final DoubleSolenoid solenoid = new DoubleSolenoid(1/*forward channel*/, 2/*reverse channel*/); public Shifter () { this.set(new ElasticController () {{ addDefault("Low Gear", new Action() { public void begin (ActionData data) { - solenoid.set(Value.kReverse); + solenoid.set(Value.kReverse); //puts the solenoid in reverse throwing the drive into low gear } }); add("High Gear", new Action() { public void begin (ActionData data) { - solenoid.set(Value.kForward); + solenoid.set(Value.kForward); //puts the solenoid forwards throwing the drive into high gear } }); }});