Finally got this code reviewed, bugfixes
authorHarel Dor <hareldor@gmail.com>
Thu, 10 Mar 2016 07:12:11 +0000 (23:12 -0800)
committerHarel Dor <hareldor@gmail.com>
Thu, 10 Mar 2016 07:12:11 +0000 (23:12 -0800)
src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGear.java
src/org/usfirst/frc/team3501/robot/commands/intakearm/StopIntake.java [deleted file]
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java

index 96f98dbc27a290138d1a2b538731ce53e82f185a..cc7e1f762727d11ba40f80c94271136ed64f6baa 100644 (file)
@@ -16,7 +16,7 @@ public class ToggleGear extends Command {
   // Called just before this Command runs the first time
   @Override
   protected void initialize() {
-    Robot.driveTrain.toggleFlipped();
+    Robot.driveTrain.switchGear();
   }
 
   // Called repeatedly when this Command is scheduled to run
diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/StopIntake.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/StopIntake.java
deleted file mode 100644 (file)
index aef6ab8..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.usfirst.frc.team3501.robot.commands.intakearm;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will take a boulder into the robot if there is not a boulder
- * present inside already.
- * 
- * pre-condition: Intake arm must be at correct height and a boulder is not
- * present inside the robot.
- * 
- * post-condition: A boulder is taken in from the field outside of the robot
- * into the robot.
- * 
- * @author Lauren and Niyati
- * 
- */
-
-public class StopIntake extends Command {
-
-  public StopIntake() {
-    requires(Robot.intakeArm);
-  }
-
-  @Override
-  protected void initialize() {
-    Robot.intakeArm.stopRollers();
-  }
-
-  @Override
-  protected void execute() {
-  }
-
-  @Override
-  protected boolean isFinished() {
-    return true;
-  }
-
-  @Override
-  protected void end() {
-  }
-
-  @Override
-  protected void interrupted() {
-  }
-
-}
index 3d406d7cbe506b886f86ed305d052d93e4953b9f..73dcde7087954b041c3e102516b973dfa4de42d1 100644 (file)
@@ -12,7 +12,9 @@ import edu.wpi.first.wpilibj.RobotDrive;
 import edu.wpi.first.wpilibj.command.PIDSubsystem;
 
 public class DriveTrain extends PIDSubsystem {
+  // Determines if the "front" of the robot has been reversed
   private boolean outputFlipped = false;
+
   private static double pidOutput = 0;
 
   private Encoder leftEncoder, rightEncoder;
@@ -193,8 +195,12 @@ public class DriveTrain extends PIDSubsystem {
 
   public void joystickDrive(double left, double right) {
     int type = Constants.DriveTrain.DRIVE_TYPE;
+
+    // Handle flipping of the "front" of the robot
     double k = (isFlipped() ? -1 : 1);
+
     if (type == Constants.DriveTrain.TANK) {
+      // TODO Test this for negation and for voltage vs. [-1,1] outputs
       double leftSpeed = (-frontLeft.get() + -rearLeft.get()) / 2;
       double rightSpeed = (-frontRight.get() + -rearRight.get()) / 2;
       left = ((Constants.DriveTrain.kADJUST - 1) * leftSpeed + left)