From da3c1b24d6dc9adfb518e64ddcbd3f2190056318 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 21 Sep 2016 12:00:49 -0400 Subject: [PATCH] Autoformatted --- .../robot/commands/autonomous/AutoDrive.java | 66 +++++++++---------- .../team2059/robot/subsystems/MainArm.java | 22 +++---- 2 files changed, 43 insertions(+), 45 deletions(-) diff --git a/src/org/usfirst/frc/team2059/robot/commands/autonomous/AutoDrive.java b/src/org/usfirst/frc/team2059/robot/commands/autonomous/AutoDrive.java index 1840ed3..5e0d63f 100644 --- a/src/org/usfirst/frc/team2059/robot/commands/autonomous/AutoDrive.java +++ b/src/org/usfirst/frc/team2059/robot/commands/autonomous/AutoDrive.java @@ -2,38 +2,38 @@ package org.usfirst.frc.team2059.robot.commands.autonomous; import org.usfirst.frc.team2059.robot.commands.CommandBase; import org.usfirst.frc.team2059.robot.Robot; public class AutoDrive extends CommandBase { - private double distance; - // Determines if we should start driving - // Will be false if we already started driving - private boolean startDriving = true; - public AutoDrive(double distance, double timeout) { - requires(driveBase); - this.distance = distance; - setTimeout(timeout); - } - public AutoDrive(double distance) { - requires(driveBase); - this.distance = distance; - // Make the default timeout 2s - setTimeout(2.0d); - } - protected void initialize() { - } - protected void execute() { - if (startDriving) { - driveBase.pidDrive(distance); - } - startDriving = false; - } - protected void end() { - startDriving = true; - driveBase.stopDriving(); - } - protected void interrupted() { - end(); - } - protected boolean isFinished() { - return isTimedOut(); - } + private double distance; + // Determines if we should start driving + // Will be false if we already started driving + private boolean startDriving = true; + public AutoDrive(double distance, double timeout) { + requires(driveBase); + this.distance = distance; + setTimeout(timeout); + } + public AutoDrive(double distance) { + requires(driveBase); + this.distance = distance; + // Make the default timeout 2s + setTimeout(2.0d); + } + protected void initialize() { + } + protected void execute() { + if (startDriving) { + driveBase.pidDrive(distance); + } + startDriving = false; + } + protected void end() { + startDriving = true; + driveBase.stopDriving(); + } + protected void interrupted() { + end(); + } + protected boolean isFinished() { + return isTimedOut(); + } } // vim: sw=2:ts=2:sts=2 diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java b/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java index 7a19462..2d17649 100644 --- a/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java +++ b/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java @@ -37,39 +37,37 @@ public class MainArm extends PIDSubsystem { public double getDegrees() { return potToDegrees(getRaw()); } - - public void resetLower(double speed){ - if(!limitSwitchBottom.get()){ + public void resetLower(double speed) { + if (!limitSwitchBottom.get()) { System.out.println("PRESSDE"); moveArm(0); return; - }else{ + } else { System.out.println("not pressed"); moveArm(speed); } } - public boolean getBottomPressed(){ + public boolean getBottomPressed() { return !limitSwitchBottom.get(); } - - public void resetUpper(double speed){ - if(!limitSwitchTop.get()){ + public void resetUpper(double speed) { + if (!limitSwitchTop.get()) { System.out.println("PRESSDE"); moveArm(0); return; - }else{ + } else { System.out.println("not pressed"); moveArm(speed); } } - public boolean getTopPressed(){ + public boolean getTopPressed() { return !limitSwitchTop.get(); } private double potToDegrees(double pot) { - if(!limitSwitchBottom.get()){ + if (!limitSwitchBottom.get()) { System.out.println("got"); min = getRaw(); - }else if(!limitSwitchTop.get()){ + } else if (!limitSwitchTop.get()) { max = getRaw(); } System.out.println((pot - min) / (Math.abs(min - max) / 90));