From a6faf7cf7b9d2ac2170aaf3627b560f96a2ccb59 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 09:37:05 -0500 Subject: [PATCH 001/121] Create vision thread --- .../org/usfirst/frc/team3494/robot/Robot.java | 55 ++++++++++++++++++- .../team3494/robot/subsystems/Drivetrain.java | 1 + 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 2dffbdf..97a5968 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -1,5 +1,11 @@ package org.usfirst.frc.team3494.robot; +import java.util.ArrayList; + +import org.opencv.core.MatOfPoint; +import org.opencv.core.Point; +import org.opencv.core.Rect; +import org.opencv.imgproc.Imgproc; import org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; @@ -7,10 +13,12 @@ import org.usfirst.frc.team3494.robot.subsystems.Intake; import org.usfirst.frc.team3494.robot.subsystems.Kompressor; import org.usfirst.frc.team3494.robot.subsystems.Turret; +import org.usfirst.frc.team3494.robot.vision.GripPipeline; import com.kauailabs.navx.frc.AHRS; import edu.wpi.cscore.UsbCamera; +import edu.wpi.cscore.VideoCamera; import edu.wpi.first.wpilibj.CameraServer; import edu.wpi.first.wpilibj.IterativeRobot; import edu.wpi.first.wpilibj.PowerDistributionPanel; @@ -21,6 +29,7 @@ import edu.wpi.first.wpilibj.livewindow.LiveWindow; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import edu.wpi.first.wpilibj.vision.VisionThread; /** * The VM is configured to automatically run this class, and to call the @@ -50,6 +59,17 @@ public class Robot extends IterativeRobot { public static SendableChooser chooser; public static Preferences prefs; + public static UsbCamera camera_0; + public static UsbCamera camera_1; + // Vision items + VisionThread visionThread; + public static double centerX = 0.0; + @SuppressWarnings("unused") + private ArrayList filteredContours; + private ArrayList averages; + + private final Object imgLock = new Object(); + /** * This function is run when the robot is first started up and should be * used for any initialization code. @@ -68,12 +88,39 @@ public void robotInit() { // Auto programs come after all subsystems are created chooser.addDefault("To the baseline!", new ConstructedAuto(AutoGenerator.crossBaseLine())); chooser.addObject("Other command", new ConstructedAuto(AutoGenerator.crossBaseLine())); - @SuppressWarnings("unused") - UsbCamera camera_0 = CameraServer.getInstance().startAutomaticCapture(0); // put chooser on DS SmartDashboard.putData("Auto mode", chooser); // get preferences prefs = Preferences.getInstance(); + camera_0 = CameraServer.getInstance().startAutomaticCapture("Gear View", 0); + camera_1 = CameraServer.getInstance().startAutomaticCapture("Intake View", 1); + // Create and start vision thread + visionThread = new VisionThread(camera_0, new GripPipeline(), pipeline -> { + if (!pipeline.filterContoursOutput().isEmpty()) { + MatOfPoint firstCont = pipeline.filterContoursOutput().get(0); + MatOfPoint secondCont = pipeline.filterContoursOutput().get(1); + double average_y_one = 0; + for (Point p : firstCont.toList()) { + average_y_one += p.y; + } + double average_y_two = 0; + for (Point p : secondCont.toList()) { + average_y_two += p.y; + } + // divide by number of points to give actual average + average_y_two = average_y_two / secondCont.toList().size(); + average_y_one = average_y_one / firstCont.toList().size(); + Rect r = Imgproc.boundingRect(pipeline.findContoursOutput().get(0)); + synchronized (imgLock) { + centerX = r.x + (r.width / 2); + filteredContours = pipeline.filterContoursOutput(); + // add averages to list + averages.add(average_y_one); + averages.add(average_y_two); + } + } + }); + visionThread.start(); } /** @@ -104,6 +151,8 @@ public void disabledPeriodic() { */ @Override public void autonomousInit() { + camera_0.setExposureManual(15); + camera_0.setWhiteBalanceManual(VideoCamera.WhiteBalance.kFixedIndoor); autonomousCommand = chooser.getSelected(); // schedule the autonomous command (example) if (autonomousCommand != null) { @@ -128,6 +177,8 @@ public void teleopInit() { if (autonomousCommand != null) { autonomousCommand.cancel(); } + camera_0.setExposureManual(50); + camera_0.setWhiteBalanceAuto(); } /** diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index e56402f..920ee38 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -104,6 +104,7 @@ public Drivetrain() { this.driveRightFollower_Two.set(driveRightMaster.getDeviceID()); this.wpiDrive = new RobotDrive(driveLeftMaster, driveRightMaster); + this.wpiDrive.setExpiration(-1); this.encRight = new Encoder(RobotMap.ENCODER_RIGHT_A, RobotMap.ENCODER_RIGHT_B); this.encRight.setDistancePerPulse(1 / 360); From 8e38e12c0c72ac9afbf49b3b5cb7778f22a5adae Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 10:30:09 -0500 Subject: [PATCH 002/121] Average X instead of Y, add Follow The Shiny auto --- .../org/usfirst/frc/team3494/robot/Robot.java | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 97a5968..6dc2b59 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -62,6 +62,9 @@ public class Robot extends IterativeRobot { public static UsbCamera camera_0; public static UsbCamera camera_1; // Vision items + private static final int IMG_WIDTH = 320; + @SuppressWarnings("unused") + private static final int IMG_HEIGHT = 240; VisionThread visionThread; public static double centerX = 0.0; @SuppressWarnings("unused") @@ -88,35 +91,38 @@ public void robotInit() { // Auto programs come after all subsystems are created chooser.addDefault("To the baseline!", new ConstructedAuto(AutoGenerator.crossBaseLine())); chooser.addObject("Other command", new ConstructedAuto(AutoGenerator.crossBaseLine())); + chooser.addObject("Follow the shiny", null); // put chooser on DS SmartDashboard.putData("Auto mode", chooser); // get preferences prefs = Preferences.getInstance(); camera_0 = CameraServer.getInstance().startAutomaticCapture("Gear View", 0); + camera_0.setResolution(IMG_WIDTH, IMG_WIDTH); camera_1 = CameraServer.getInstance().startAutomaticCapture("Intake View", 1); // Create and start vision thread visionThread = new VisionThread(camera_0, new GripPipeline(), pipeline -> { if (!pipeline.filterContoursOutput().isEmpty()) { MatOfPoint firstCont = pipeline.filterContoursOutput().get(0); MatOfPoint secondCont = pipeline.filterContoursOutput().get(1); - double average_y_one = 0; + double average_x_one = 0; for (Point p : firstCont.toList()) { - average_y_one += p.y; + average_x_one += p.x; } - double average_y_two = 0; + double average_x_two = 0; for (Point p : secondCont.toList()) { - average_y_two += p.y; + average_x_two += p.x; } // divide by number of points to give actual average - average_y_two = average_y_two / secondCont.toList().size(); - average_y_one = average_y_one / firstCont.toList().size(); + average_x_two = average_x_two / secondCont.toList().size(); + average_x_one = average_x_one / firstCont.toList().size(); Rect r = Imgproc.boundingRect(pipeline.findContoursOutput().get(0)); synchronized (imgLock) { centerX = r.x + (r.width / 2); filteredContours = pipeline.filterContoursOutput(); // add averages to list - averages.add(average_y_one); - averages.add(average_y_two); + averages.clear(); + averages.add(average_x_one); + averages.add(average_x_two); } } }); @@ -157,6 +163,8 @@ public void autonomousInit() { // schedule the autonomous command (example) if (autonomousCommand != null) { autonomousCommand.start(); + } else { + System.out.println("Defaulting to track the shiny"); } } @@ -165,7 +173,17 @@ public void autonomousInit() { */ @Override public void autonomousPeriodic() { - Scheduler.getInstance().run(); + if (autonomousCommand != null) { + Scheduler.getInstance().run(); + } else { + double centerX; + synchronized (imgLock) { + centerX = Robot.centerX; + } + double turn = centerX - (Robot.IMG_WIDTH / 2); + // drive with turn + driveTrain.wpiDrive.arcadeDrive(0.5, (turn * 0.005) * -1); + } } @Override From a0a22795234a3966e5efb49837f76c3b1ef30f02 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 10:33:08 -0500 Subject: [PATCH 003/121] Add total average variable --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 6dc2b59..dba7b0a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -67,6 +67,7 @@ public class Robot extends IterativeRobot { private static final int IMG_HEIGHT = 240; VisionThread visionThread; public static double centerX = 0.0; + public static double absolutelyAverage = 0.0; @SuppressWarnings("unused") private ArrayList filteredContours; private ArrayList averages; @@ -118,6 +119,7 @@ public void robotInit() { Rect r = Imgproc.boundingRect(pipeline.findContoursOutput().get(0)); synchronized (imgLock) { centerX = r.x + (r.width / 2); + absolutelyAverage = (average_x_two + average_x_one) / 2; filteredContours = pipeline.filterContoursOutput(); // add averages to list averages.clear(); From 73bf44a4da3b00693a87c85f285a75b7368576cb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 11:07:58 -0500 Subject: [PATCH 004/121] Misc climber fixes --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 2 ++ .../frc/team3494/robot/commands/drive/HoldDriveTrain.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index dba7b0a..34adacf 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -224,6 +224,8 @@ public void teleopPeriodic() { SmartDashboard.putNumber("Motor 13", Robot.pdp.getCurrent(13)); SmartDashboard.putNumber("Motor 14", Robot.pdp.getCurrent(14)); SmartDashboard.putNumber("Motor 15", Robot.pdp.getCurrent(15)); + + SmartDashboard.putNumber("Climber Motor", Robot.pdp.getCurrent(RobotMap.CLIMBER_MOTOR_PDP)); } /** diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java index 4638d6a..6db5196 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java @@ -21,7 +21,7 @@ protected void initialize() { // Called repeatedly when this Command is scheduled to run protected void execute() { - Robot.driveTrain.adjustedTankDrive(0.2, 0.2); + Robot.driveTrain.adjustedTankDrive(-0.2, -0.2); } // Make this return true when this Command no longer needs to run execute() From cb93ad7197d9550c4a6fc3ca3f4f8e3a4a19d86c Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 11:08:40 -0500 Subject: [PATCH 005/121] Fix PDP channel --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java index f79871b..397a6f3 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java @@ -41,7 +41,7 @@ public class RobotMap { public static final int UP_MOTOR = 4; // climber public static final int CLIMBER_MOTOR = 1; - public static final int CLIMBER_MOTOR_PDP = 10; + public static final int CLIMBER_MOTOR_PDP = 11; public static final int CLIMBER_PTO_FORWARD = 6; public static final int CLIMBER_PTO_BACKARD = 7; // turret From 183bf0eb6a0e6f088e4b953be40743ba63f9080b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 11:13:28 -0500 Subject: [PATCH 006/121] Add missing overrides --- .../frc/team3494/robot/commands/drive/HoldDriveTrain.java | 5 +++++ .../frc/team3494/robot/commands/gears/HoldInState.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java index 6db5196..be4cc2d 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java @@ -16,25 +16,30 @@ public HoldDriveTrain() { } // Called just before this Command runs the first time + @Override protected void initialize() { } // Called repeatedly when this Command is scheduled to run + @Override protected void execute() { Robot.driveTrain.adjustedTankDrive(-0.2, -0.2); } // Make this return true when this Command no longer needs to run execute() + @Override protected boolean isFinished() { return false; } // Called once after isFinished returns true + @Override protected void end() { } // Called when another command which requires one or more of the same // subsystems is scheduled to run + @Override protected void interrupted() { } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java index 008b531..223143a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java @@ -17,26 +17,31 @@ public HoldInState() { } // Called just before this Command runs the first time + @Override protected void initialize() { } // Called repeatedly when this Command is scheduled to run + @Override protected void execute() { Robot.gearTake.setGrasp(Value.kForward); } // Make this return true when this Command no longer needs to run execute() + @Override protected boolean isFinished() { return false; } // Called once after isFinished returns true + @Override protected void end() { Robot.gearTake.setGrasp(Value.kReverse); } // Called when another command which requires one or more of the same // subsystems is scheduled to run + @Override protected void interrupted() { this.end(); } From 2b29dabe366519eb209793f0ba5b7dcbe522c75d Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 12:52:36 -0500 Subject: [PATCH 007/121] Control reorganization --- .../src/org/usfirst/frc/team3494/robot/OI.java | 15 ++++++++++++--- .../src/org/usfirst/frc/team3494/robot/Robot.java | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index 61a7ce6..7d9560c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -46,6 +46,7 @@ public class OI { // until it is finished as determined by it's isFinished method. // button.whenReleased(new ExampleCommand()); public JoystickButton xbox_a = new JoystickButton(xbox, 1); + public JoystickButton xbox_a_2 = new JoystickButton(xbox_2, 1); public JoystickButton xbox_lt = new JoystickButton(xbox, 5); @@ -59,20 +60,28 @@ public class OI { public JoystickButton xbox_y_2 = new JoystickButton(xbox_2, 4); public JoystickButton xbox_x = new JoystickButton(xbox, 3); + public JoystickButton xbox_x_2 = new JoystickButton(xbox_2, 3); public JoystickButton xbox_select_2 = new JoystickButton(xbox_2, 7); public JoystickButton xbox_start_2 = new JoystickButton(xbox_2, 8); public OI() { // Ready Player One - xbox_b.whileHeld(new Climb(DriveDirections.UP)); - xbox_b.whenReleased(new StopClimber()); - xbox_x.whileHeld(new HoldInState()); + // Ready Player Two + // Climb controls + xbox_a_2.whileActive(new Climb(DriveDirections.UP)); + xbox_a_2.whenReleased(new StopClimber()); + // Intake motion xbox_b_2.whenPressed(new SwitchPosition()); + + xbox_x_2.whileHeld(new HoldInState()); + xbox_y_2.whenPressed(new ToggleGearRamp()); + xbox_rt_2.whenPressed(new Shoot()); xbox_rt_2.whenReleased(new Shoot(0)); + xbox_select_2.whenPressed(new ClimberToggle()); xbox_start_2.whileHeld(new HoldDriveTrain()); } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 34adacf..39c362b 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -197,7 +197,7 @@ public void teleopInit() { if (autonomousCommand != null) { autonomousCommand.cancel(); } - camera_0.setExposureManual(50); + camera_0.setExposureManual(40); camera_0.setWhiteBalanceAuto(); } From 2893b3607f4258c9cfd9682bfe794fc099b556aa Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 14:34:15 -0500 Subject: [PATCH 008/121] Correct baseline distance --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 6e67432..855e0bd 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -41,7 +41,7 @@ public static ArrayList autoOne() { */ public static ArrayList crossBaseLine() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(100, UnitTypes.INCHES)); + list.add(new DistanceDrive(240, UnitTypes.INCHES)); return list; } From b576bbdc4113eda0eb7b28dd2f255f8c09174a96 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 14:34:32 -0500 Subject: [PATCH 009/121] Minor changes to distance getters --- .../usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 920ee38..fb9ad80 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -166,7 +166,7 @@ public void adjustedTankDrive(double left, double right) { * unit. */ public double getRightDistance(UnitTypes unit) { - double inches = (Math.PI * 4) * (this.encRight.get() / 360); + double inches = (Math.PI * 4) * (this.encRight.getDistance()); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -188,7 +188,7 @@ public double getRightDistance(UnitTypes unit) { * @return The distance the left encoder has counted, in the specified unit. */ public double getLeftDistance(UnitTypes unit) { - double inches = (Math.PI * 4) * (this.encLeft.get() / 360.0D); + double inches = (Math.PI * 4) * (this.encLeft.getDistance()); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -198,12 +198,12 @@ public double getLeftDistance(UnitTypes unit) { } else if (unit.equals(UnitTypes.CENTIMETERS)) { return inches * 2.540; } else { - return this.encRight.get(); + return this.encLeft.get(); } } public double getAvgDistance(UnitTypes unit) { - return ((this.getLeftDistance(unit) + this.getRightDistance(unit)) / 2); + return (this.getLeftDistance(unit) + this.getRightDistance(unit)) / 2; } /** From 6ac9eee73e1fbe8527ff75e34bf09f2a7f3e05b4 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 14:34:51 -0500 Subject: [PATCH 010/121] Change camera settings...again --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 39c362b..4536bd4 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -98,7 +98,6 @@ public void robotInit() { // get preferences prefs = Preferences.getInstance(); camera_0 = CameraServer.getInstance().startAutomaticCapture("Gear View", 0); - camera_0.setResolution(IMG_WIDTH, IMG_WIDTH); camera_1 = CameraServer.getInstance().startAutomaticCapture("Intake View", 1); // Create and start vision thread visionThread = new VisionThread(camera_0, new GripPipeline(), pipeline -> { @@ -197,7 +196,7 @@ public void teleopInit() { if (autonomousCommand != null) { autonomousCommand.cancel(); } - camera_0.setExposureManual(40); + camera_0.setExposureManual(50); camera_0.setWhiteBalanceAuto(); } From f346969bc0242536f2f18e436c4e922c4ec46832 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 15:09:55 -0500 Subject: [PATCH 011/121] Format source --- .../src/org/usfirst/frc/team3494/robot/OI.java | 10 +++++----- .../src/org/usfirst/frc/team3494/robot/Robot.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index 7d9560c..7ffe37e 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -67,21 +67,21 @@ public class OI { public OI() { // Ready Player One - + // Ready Player Two // Climb controls xbox_a_2.whileActive(new Climb(DriveDirections.UP)); xbox_a_2.whenReleased(new StopClimber()); // Intake motion xbox_b_2.whenPressed(new SwitchPosition()); - + xbox_x_2.whileHeld(new HoldInState()); - + xbox_y_2.whenPressed(new ToggleGearRamp()); - + xbox_rt_2.whenPressed(new Shoot()); xbox_rt_2.whenReleased(new Shoot(0)); - + xbox_select_2.whenPressed(new ClimberToggle()); xbox_start_2.whileHeld(new HoldDriveTrain()); } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 4536bd4..06fe657 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -223,7 +223,7 @@ public void teleopPeriodic() { SmartDashboard.putNumber("Motor 13", Robot.pdp.getCurrent(13)); SmartDashboard.putNumber("Motor 14", Robot.pdp.getCurrent(14)); SmartDashboard.putNumber("Motor 15", Robot.pdp.getCurrent(15)); - + SmartDashboard.putNumber("Climber Motor", Robot.pdp.getCurrent(RobotMap.CLIMBER_MOTOR_PDP)); } From 69c03b2b72825d18bc00b24a97850cae258add5f Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 15:10:07 -0500 Subject: [PATCH 012/121] Final fixes to encoders --- .../frc/team3494/robot/subsystems/Drivetrain.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index fb9ad80..957dee3 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -166,7 +166,7 @@ public void adjustedTankDrive(double left, double right) { * unit. */ public double getRightDistance(UnitTypes unit) { - double inches = (Math.PI * 4) * (this.encRight.getDistance()); + double inches = (Math.PI * 4) * (this.encRight.get() / 360); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -188,7 +188,7 @@ public double getRightDistance(UnitTypes unit) { * @return The distance the left encoder has counted, in the specified unit. */ public double getLeftDistance(UnitTypes unit) { - double inches = (Math.PI * 4) * (this.encLeft.getDistance()); + double inches = (Math.PI * 4) * (this.encLeft.get() / 360); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -213,8 +213,11 @@ public void resetRight() { this.encRight.reset(); } + /** + * Resets the encoder on the left side of the drivetrain. + */ public void resetLeft() { - this.encRight.reset(); + this.encLeft.reset(); } @Override From ab724222939706d314b2314d7925c0e8cdf96b6b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 15:10:21 -0500 Subject: [PATCH 013/121] Fix arcade drive --- .../org/usfirst/frc/team3494/robot/commands/drive/Drive.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index cdcf84e..8ecccd9 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -43,7 +43,7 @@ protected void execute() { -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter); } else { Robot.driveTrain.wpiDrive.arcadeDrive(Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter, - -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter); + Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter); } } else { if (!Robot.driveTrain.getInverted()) { From c657dc56493df364ff9a63880a7dd1e0dacb3b68 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 15:10:37 -0500 Subject: [PATCH 014/121] Quick 'n dirty distance fix --- .../frc/team3494/robot/commands/auto/DistanceDrive.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index a596a4b..bc69d2c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -57,8 +57,9 @@ protected void execute() { // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { - return (Robot.driveTrain.getAvgDistance(this.unit) >= this.dist - 1 - && Robot.driveTrain.getAvgDistance(this.unit) <= this.dist + 1); + return (this.dist >= Robot.driveTrain.getAvgDistance(this.unit) - 1 + && this.dist <= Robot.driveTrain.getAvgDistance(this.unit) + 1) + || (this.dist < Robot.driveTrain.getAvgDistance(unit) && this.dist > 0); } // Called once after isFinished returns true From f0818ac4ea1c7e396ed5f5b78e8d2bc3e437d746 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 18:12:27 -0500 Subject: [PATCH 015/121] Allow driver to limit drivetrain speed to 50% Some major FMS lag today. Wonder that that's all about. --- .../frc/team3494/robot/commands/drive/Drive.java | 14 ++++++++++---- .../frc/team3494/robot/subsystems/Drivetrain.java | 12 +++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 8ecccd9..16c9569 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -36,14 +36,20 @@ protected void execute() { Robot.driveTrain.inverter = 1; } else if (dpad == 180) { Robot.driveTrain.inverter = -1; + } else if (dpad == 270) { + Robot.driveTrain.scaleDown = 0.5D; + } else if (dpad == 90) { + Robot.driveTrain.scaleDown = 1.0D; } if (Robot.prefs.getBoolean("arcade", true)) { if (!Robot.driveTrain.getInverted()) { - Robot.driveTrain.wpiDrive.arcadeDrive(Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter, - -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter); + Robot.driveTrain.wpiDrive.arcadeDrive( + Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); } else { - Robot.driveTrain.wpiDrive.arcadeDrive(Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter, - Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter); + Robot.driveTrain.wpiDrive.arcadeDrive( + Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); } } else { if (!Robot.driveTrain.getInverted()) { diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 957dee3..d87f9b9 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -69,6 +69,7 @@ public class Drivetrain extends Subsystem implements IMotorizedSubsystem { private static double RAMP = 1.1730125; // lowest possible ramp public int inverter = 1; + public double scaleDown = 1; public Drivetrain() { super("Drivetrain"); @@ -104,7 +105,8 @@ public Drivetrain() { this.driveRightFollower_Two.set(driveRightMaster.getDeviceID()); this.wpiDrive = new RobotDrive(driveLeftMaster, driveRightMaster); - this.wpiDrive.setExpiration(-1); + this.wpiDrive.setExpiration(Integer.MAX_VALUE); + this.wpiDrive.setSafetyEnabled(false); this.encRight = new Encoder(RobotMap.ENCODER_RIGHT_A, RobotMap.ENCODER_RIGHT_B); this.encRight.setDistancePerPulse(1 / 360); @@ -136,8 +138,8 @@ public void initDefaultCommand() { * between 0 and 1. */ public void TankDrive(double left, double right) { - driveLeftMaster.set(left); - driveRightMaster.set(right); + driveLeftMaster.set(left * this.scaleDown); + driveRightMaster.set(right * this.scaleDown); } /** @@ -153,8 +155,8 @@ public void TankDrive(double left, double right) { * Talons. */ public void adjustedTankDrive(double left, double right) { - driveLeftMaster.set(-left); - driveRightMaster.set(right); + driveLeftMaster.set(-left * this.scaleDown); + driveRightMaster.set(right * this.scaleDown); } /** From c2017aef7d7f46703e2540439ca35c212e4ff008 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 4 Mar 2017 19:13:36 -0500 Subject: [PATCH 016/121] Lower left side power a bit --- .../frc/team3494/robot/commands/auto/DistanceDrive.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index bc69d2c..dcbfadc 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -45,9 +45,9 @@ protected void initialize() { @Override protected void execute() { if (this.dist > Robot.driveTrain.getAvgDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(0.4, 0.4); + Robot.driveTrain.adjustedTankDrive(0.38, 0.4); } else if (this.dist < Robot.driveTrain.getAvgDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(-0.4, -0.4); + Robot.driveTrain.adjustedTankDrive(-0.38, -0.4); } else { return; } From 1ba2aa5d235847a0e4478e6cba659ccbe9eae763 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sun, 5 Mar 2017 08:25:55 -0500 Subject: [PATCH 017/121] Lower left power --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index d87f9b9..fbdc64a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -138,7 +138,7 @@ public void initDefaultCommand() { * between 0 and 1. */ public void TankDrive(double left, double right) { - driveLeftMaster.set(left * this.scaleDown); + driveLeftMaster.set(left * this.scaleDown * 0.95); driveRightMaster.set(right * this.scaleDown); } @@ -155,7 +155,7 @@ public void TankDrive(double left, double right) { * Talons. */ public void adjustedTankDrive(double left, double right) { - driveLeftMaster.set(-left * this.scaleDown); + driveLeftMaster.set(-left * this.scaleDown * 0.95); driveRightMaster.set(right * this.scaleDown); } From ed39d3079c91d3d24e133a3529d52d2ced242c00 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sun, 5 Mar 2017 08:51:15 -0500 Subject: [PATCH 018/121] Remove compounded slowness --- .../frc/team3494/robot/commands/auto/DistanceDrive.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index dcbfadc..bc69d2c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -45,9 +45,9 @@ protected void initialize() { @Override protected void execute() { if (this.dist > Robot.driveTrain.getAvgDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(0.38, 0.4); + Robot.driveTrain.adjustedTankDrive(0.4, 0.4); } else if (this.dist < Robot.driveTrain.getAvgDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(-0.38, -0.4); + Robot.driveTrain.adjustedTankDrive(-0.4, -0.4); } else { return; } From c90dd876d6a1c04c1f0daf2deec73f73ae044fe8 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sun, 5 Mar 2017 08:51:34 -0500 Subject: [PATCH 019/121] Merge tank and ajusted --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index fbdc64a..4238512 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -155,8 +155,7 @@ public void TankDrive(double left, double right) { * Talons. */ public void adjustedTankDrive(double left, double right) { - driveLeftMaster.set(-left * this.scaleDown * 0.95); - driveRightMaster.set(right * this.scaleDown); + this.TankDrive(-left, right); } /** From e033c14e359fd3b25fc9379fa8b2cbb5c3bd5b7b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sun, 5 Mar 2017 11:06:50 -0500 Subject: [PATCH 020/121] Disengage PTO on start --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 1 + 1 file changed, 1 insertion(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 06fe657..5202665 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -83,6 +83,7 @@ public void robotInit() { chooser = new SendableChooser(); driveTrain = new Drivetrain(); climber = new Climber(); + climber.disengagePTO(); turret = new Turret(); kompressor = new Kompressor(); intake = new Intake(); From 333e876f9ea00262893ec0da989e7c90449ee77f Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sun, 5 Mar 2017 11:07:05 -0500 Subject: [PATCH 021/121] Do more things when the climber starts --- .../frc/team3494/robot/commands/climb/ClimberToggle.java | 7 +++++++ .../frc/team3494/robot/commands/drive/HoldDriveTrain.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java index 0bdc86a..ba580f7 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java @@ -2,6 +2,7 @@ import org.usfirst.frc.team3494.robot.Robot; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.command.Command; /** @@ -13,6 +14,8 @@ public ClimberToggle() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); requires(Robot.climber); + requires(Robot.kompressor); + requires(Robot.gearTake); } // Called just before this Command runs the first time @@ -25,8 +28,12 @@ protected void initialize() { protected void execute() { if (!Robot.climber.getState()) { Robot.climber.engagePTO(); + Robot.kompressor.compress.stop(); + Robot.gearTake.setRamp(Value.kReverse); + Robot.gearTake.setGrasp(Value.kForward); } else { Robot.climber.disengagePTO(); + Robot.kompressor.compress.start(); } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java index be4cc2d..7b60870 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.java @@ -29,7 +29,7 @@ protected void execute() { // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { - return false; + return true; } // Called once after isFinished returns true From f89ab22c895bec2f55739c3414f98f5a3363f21c Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sun, 5 Mar 2017 12:53:01 -0500 Subject: [PATCH 022/121] Start gear placement revisions --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 5 +---- .../usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 855e0bd..7d653ef 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -2,7 +2,6 @@ import java.util.ArrayList; -import org.usfirst.frc.team3494.robot.commands.auto.AngleTurn; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; @@ -47,9 +46,7 @@ public static ArrayList crossBaseLine() { public static ArrayList gearPlaceAttempt() { ArrayList list = new ArrayList(); - list.add(new AngleTurn(180)); - list.add(new AngleTurn(-10)); - list.add(new DistanceDrive(-5, UnitTypes.INCHES)); + list.add(new DistanceDrive(93.25, UnitTypes.INCHES)); // list.add(new XYDrive()); return list; } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 4238512..d5c52af 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -66,7 +66,7 @@ public class Drivetrain extends Subsystem implements IMotorizedSubsystem { private Encoder encRight; private Encoder encLeft; - private static double RAMP = 1.1730125; // lowest possible ramp + private static double RAMP = 1.173; public int inverter = 1; public double scaleDown = 1; From 23099b4ed878360b7cd733337a6de8a351acb05e Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Mon, 6 Mar 2017 16:38:21 -0500 Subject: [PATCH 023/121] Revise gear place attempt --- .../org/usfirst/frc/team3494/robot/AutoGenerator.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 7d653ef..a0107ad 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -2,6 +2,7 @@ import java.util.ArrayList; +import org.usfirst.frc.team3494.robot.commands.auto.AngleTurn; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; @@ -47,7 +48,13 @@ public static ArrayList crossBaseLine() { public static ArrayList gearPlaceAttempt() { ArrayList list = new ArrayList(); list.add(new DistanceDrive(93.25, UnitTypes.INCHES)); - // list.add(new XYDrive()); + list.add(new AngleTurn(-180)); + double rise = 20.462; + double run = 32.463; + list.add(new AngleTurn(Math.toDegrees(Math.atan2(20.462, 32.463)))); + double dist = 0; + dist = Math.sqrt((rise * rise) + (run * run)); + list.add(new DistanceDrive(-dist, UnitTypes.INCHES)); return list; } } From 4515924541ca096dff406b3160a7834f2ca66389 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Tue, 7 Mar 2017 16:36:39 -0500 Subject: [PATCH 024/121] Drivetrain staging test --- .../org/usfirst/frc/team3494/robot/Robot.java | 2 + .../robot/commands/auto/StageTest.java | 42 ++++++++++++ .../team3494/robot/subsystems/Drivetrain.java | 65 ++++++++++++++++++- 3 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 5202665..ed95184 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -7,6 +7,7 @@ import org.opencv.core.Rect; import org.opencv.imgproc.Imgproc; import org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto; +import org.usfirst.frc.team3494.robot.commands.auto.StageTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; import org.usfirst.frc.team3494.robot.subsystems.GearTake; @@ -93,6 +94,7 @@ public void robotInit() { // Auto programs come after all subsystems are created chooser.addDefault("To the baseline!", new ConstructedAuto(AutoGenerator.crossBaseLine())); chooser.addObject("Other command", new ConstructedAuto(AutoGenerator.crossBaseLine())); + chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); // put chooser on DS SmartDashboard.putData("Auto mode", chooser); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java new file mode 100644 index 0000000..0233cb2 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java @@ -0,0 +1,42 @@ +package org.usfirst.frc.team3494.robot.commands.auto; + +import org.usfirst.frc.team3494.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * + */ +public class StageTest extends Command { + private int counter; + public StageTest() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.driveTrain); + } + + // Called just before this Command runs the first time + protected void initialize() { + Robot.driveTrain.initStaging(); + Robot.driveTrain.stagedTankDrive(-0.4, 0.4); + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + this.counter++; + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return counter > 100; + } + + // Called once after isFinished returns true + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } +} diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index d5c52af..305a60c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -1,10 +1,12 @@ package org.usfirst.frc.team3494.robot.subsystems; +import org.usfirst.frc.team3494.robot.Robot; import org.usfirst.frc.team3494.robot.RobotMap; import org.usfirst.frc.team3494.robot.UnitTypes; import org.usfirst.frc.team3494.robot.commands.drive.Drive; import com.ctre.CANTalon; +import com.ctre.CANTalon.TalonControlMode; import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.RobotDrive; @@ -71,9 +73,12 @@ public class Drivetrain extends Subsystem implements IMotorizedSubsystem { public int inverter = 1; public double scaleDown = 1; + private CANTalon[] leftSide; + private CANTalon[] rightSide; + public Drivetrain() { super("Drivetrain"); - + // create left talons this.driveLeftMaster = new CANTalon(RobotMap.leftTalonOne); this.driveLeftMaster.enableBrakeMode(true); this.driveLeftMaster.setVoltageRampRate(RAMP); @@ -88,6 +93,8 @@ public Drivetrain() { this.driveLeftFollower_One.set(driveLeftMaster.getDeviceID()); this.driveLeftFollower_Two.changeControlMode(CANTalon.TalonControlMode.Follower); this.driveLeftFollower_Two.set(driveLeftMaster.getDeviceID()); + // create list + this.leftSide = new CANTalon[] { this.driveLeftMaster, this.driveLeftFollower_One, this.driveLeftFollower_Two }; this.driveRightMaster = new CANTalon(RobotMap.rightTalonOne); this.driveRightMaster.enableBrakeMode(true); @@ -103,6 +110,9 @@ public Drivetrain() { this.driveRightFollower_One.set(driveRightMaster.getDeviceID()); this.driveRightFollower_Two.changeControlMode(CANTalon.TalonControlMode.Follower); this.driveRightFollower_Two.set(driveRightMaster.getDeviceID()); + // list time! + this.rightSide = new CANTalon[] { this.driveRightMaster, this.driveRightFollower_One, + this.driveLeftFollower_Two }; this.wpiDrive = new RobotDrive(driveLeftMaster, driveRightMaster); this.wpiDrive.setExpiration(Integer.MAX_VALUE); @@ -138,7 +148,7 @@ public void initDefaultCommand() { * between 0 and 1. */ public void TankDrive(double left, double right) { - driveLeftMaster.set(left * this.scaleDown * 0.95); + driveLeftMaster.set(left * this.scaleDown * Robot.prefs.getDouble("left side multiplier", 1.0D)); driveRightMaster.set(right * this.scaleDown); } @@ -240,4 +250,55 @@ public void setAll(double speed) { public boolean getInverted() { return this.inverter == -1; } + + /** + * Stage-sets the drivetrain. Please, for the love of all that is holy call + * {@link Drivetrain#snapBackToReality()} after this. + * + * @param left + * The left power + * @param right + * The right power + */ + public void stagedTankDrive(double left, double right) { + this.driveLeftMaster.set(left); + this.driveRightMaster.set(right); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + this.driveLeftFollower_One.set(left); + this.driveRightFollower_One.set(right); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + this.driveLeftFollower_Two.set(left); + this.driveRightFollower_Two.set(right); + } + + public void initStaging() { + // change all to be percent Vbus + for (CANTalon t : this.leftSide) { + t.changeControlMode(TalonControlMode.PercentVbus); + } + for (CANTalon t : this.rightSide) { + t.changeControlMode(TalonControlMode.PercentVbus); + } + } + + public void snapBackToReality() { + // left reset + this.driveLeftFollower_One.changeControlMode(TalonControlMode.Follower); + this.driveLeftFollower_Two.changeControlMode(TalonControlMode.Follower); + this.driveLeftFollower_One.set(this.driveLeftMaster.getDeviceID()); + this.driveLeftFollower_Two.set(this.driveLeftMaster.getDeviceID()); + // right reset + this.driveRightFollower_One.changeControlMode(TalonControlMode.Follower); + this.driveRightFollower_Two.changeControlMode(TalonControlMode.Follower); + this.driveRightFollower_One.set(this.driveRightMaster.getDeviceID()); + this.driveRightFollower_Two.set(this.driveRightMaster.getDeviceID()); + } } From 52b9ce3b32834f5dc3190cf0e26073d52de79102 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:02:56 -0500 Subject: [PATCH 025/121] Repair drivetrain after stagetest --- .../org/usfirst/frc/team3494/robot/commands/auto/StageTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java index 0233cb2..da69c33 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java @@ -33,6 +33,8 @@ protected boolean isFinished() { // Called once after isFinished returns true protected void end() { + Robot.driveTrain.snapBackToReality(); + Robot.driveTrain.setAll(0); } // Called when another command which requires one or more of the same From eb052ece7b0b647215aedc28ab8cce9899ef706a Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:03:29 -0500 Subject: [PATCH 026/121] Revise inversion --- .../frc/team3494/robot/commands/drive/Drive.java | 9 ++++++--- .../frc/team3494/robot/subsystems/Drivetrain.java | 13 +++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 16c9569..e55c88c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -4,6 +4,7 @@ import edu.wpi.first.wpilibj.GenericHID.Hand; import edu.wpi.first.wpilibj.command.Command; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; /** * Command to run drivetrain. Only takes input in the form of joysticks. @@ -41,15 +42,17 @@ protected void execute() { } else if (dpad == 90) { Robot.driveTrain.scaleDown = 1.0D; } + SmartDashboard.putNumber("inverter", Robot.driveTrain.inverter); + SmartDashboard.putNumber("scale down", Robot.driveTrain.scaleDown); if (Robot.prefs.getBoolean("arcade", true)) { - if (!Robot.driveTrain.getInverted()) { + if (Robot.driveTrain.getInverted()) { Robot.driveTrain.wpiDrive.arcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); + -Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); } else { Robot.driveTrain.wpiDrive.arcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); + Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); } } else { if (!Robot.driveTrain.getInverted()) { diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 305a60c..ee0a7b1 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -68,16 +68,17 @@ public class Drivetrain extends Subsystem implements IMotorizedSubsystem { private Encoder encRight; private Encoder encLeft; - private static double RAMP = 1.173; + private static double RAMP = 48; public int inverter = 1; - public double scaleDown = 1; + public double scaleDown = -1; private CANTalon[] leftSide; private CANTalon[] rightSide; public Drivetrain() { super("Drivetrain"); + // int maxAmps = 50; // create left talons this.driveLeftMaster = new CANTalon(RobotMap.leftTalonOne); this.driveLeftMaster.enableBrakeMode(true); @@ -106,9 +107,9 @@ public Drivetrain() { this.driveRightFollower_Two.enableBrakeMode(true); this.driveRightFollower_Two.setVoltageRampRate(RAMP); // master follower - this.driveRightFollower_One.changeControlMode(CANTalon.TalonControlMode.Follower); + this.driveRightFollower_One.changeControlMode(TalonControlMode.Follower); this.driveRightFollower_One.set(driveRightMaster.getDeviceID()); - this.driveRightFollower_Two.changeControlMode(CANTalon.TalonControlMode.Follower); + this.driveRightFollower_Two.changeControlMode(TalonControlMode.Follower); this.driveRightFollower_Two.set(driveRightMaster.getDeviceID()); // list time! this.rightSide = new CANTalon[] { this.driveRightMaster, this.driveRightFollower_One, @@ -264,14 +265,14 @@ public void stagedTankDrive(double left, double right) { this.driveLeftMaster.set(left); this.driveRightMaster.set(right); try { - Thread.sleep(500); + Thread.sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } this.driveLeftFollower_One.set(left); this.driveRightFollower_One.set(right); try { - Thread.sleep(500); + Thread.sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } From 86610479968b639746c1031bf1222da830d6df85 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:06:23 -0500 Subject: [PATCH 027/121] Revise distance drive to time three thousand --- .../robot/commands/auto/DistanceDrive.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index bc69d2c..4c00aee 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -44,9 +44,9 @@ protected void initialize() { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - if (this.dist > Robot.driveTrain.getAvgDistance(this.unit)) { + if (this.dist > Robot.driveTrain.getRightDistance(this.unit)) { Robot.driveTrain.adjustedTankDrive(0.4, 0.4); - } else if (this.dist < Robot.driveTrain.getAvgDistance(this.unit)) { + } else if (this.dist < Robot.driveTrain.getRightDistance(this.unit)) { Robot.driveTrain.adjustedTankDrive(-0.4, -0.4); } else { return; @@ -57,9 +57,13 @@ protected void execute() { // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { - return (this.dist >= Robot.driveTrain.getAvgDistance(this.unit) - 1 - && this.dist <= Robot.driveTrain.getAvgDistance(this.unit) + 1) - || (this.dist < Robot.driveTrain.getAvgDistance(unit) && this.dist > 0); + boolean isDone; + if (this.dist < 0) { + isDone = Robot.driveTrain.getRightDistance(this.unit) < this.dist; + } else { + isDone = Robot.driveTrain.getRightDistance(this.unit) > this.dist; + } + return isDone; } // Called once after isFinished returns true From e1c877d7b01ac0ec01276dd6819499906a164e65 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:06:37 -0500 Subject: [PATCH 028/121] Create center gear placer --- .../usfirst/frc/team3494/robot/AutoGenerator.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index a0107ad..e7231af 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -5,6 +5,8 @@ import org.usfirst.frc.team3494.robot.commands.auto.AngleTurn; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; +import org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition; +import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; import edu.wpi.first.wpilibj.command.Command; @@ -41,7 +43,16 @@ public static ArrayList autoOne() { */ public static ArrayList crossBaseLine() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(240, UnitTypes.INCHES)); + list.add(new DistanceDrive(-112, UnitTypes.INCHES)); + return list; + } + + public static ArrayList placeCenterGear() { + ArrayList list = new ArrayList(); + list.add(new DistanceDrive(-76, UnitTypes.INCHES)); + list.add(new SetGearPosition()); + list.add(new ToggleGearRamp()); + list.add(new DistanceDrive(10, UnitTypes.INCHES)); return list; } From 28a5a46bb5f57f52e7d4cd26a0db7993f4372bf1 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:06:54 -0500 Subject: [PATCH 029/121] Create LineBreak sensor class --- .../frc/team3494/robot/sensors/LineBreak.java | 33 +++++++++++++++++++ .../team3494/robot/sensors/package-info.java | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/package-info.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java new file mode 100644 index 0000000..a91294a --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java @@ -0,0 +1,33 @@ +package org.usfirst.frc.team3494.robot.sensors; + +import edu.wpi.first.wpilibj.AnalogInput; +import edu.wpi.first.wpilibj.AnalogTrigger; + +public class LineBreak { + /** + * Actual analog channel. + */ + private AnalogInput ai1; + /** + * Analog trigger object. + */ + private AnalogTrigger trigger1; + public LineBreak(int channel) { + this.ai1 = new AnalogInput(channel); + this.trigger1 = new AnalogTrigger(ai1); + this.trigger1.setLimitsVoltage(0.777, 3.703); + } + public LineBreak() { + this(1); + } + /** + * Returns true if the trigger is broken. + */ + public boolean getBroken() { + if (!this.trigger1.getInWindow()) { + return trigger1.getTriggerState(); + } else { + return false; + } + } +} diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/package-info.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/package-info.java new file mode 100644 index 0000000..5ec6a82 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/package-info.java @@ -0,0 +1,4 @@ +/** + * Package for sensor type classes. + */ +package org.usfirst.frc.team3494.robot.sensors; \ No newline at end of file From cd31ccffbe9532e637f0e5097e3f58ccdd2aa395 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:07:40 -0500 Subject: [PATCH 030/121] Create seperate pipeline for gear placement --- .../team3494/robot/vision/GearPipeline.java | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java new file mode 100644 index 0000000..8b45b2d --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java @@ -0,0 +1,215 @@ +package org.usfirst.frc.team3494.robot.vision; + +import java.util.ArrayList; +import java.util.List; + +import org.opencv.core.Core; +import org.opencv.core.CvType; +import org.opencv.core.Mat; +import org.opencv.core.MatOfInt; +import org.opencv.core.MatOfPoint; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.Rect; +import org.opencv.core.Scalar; +import org.opencv.imgproc.Imgproc; + +import edu.wpi.first.wpilibj.vision.VisionPipeline; + +/** + * GearPipeline class. + * + *

+ * An OpenCV pipeline generated by GRIP. + * + * @author GRIP + */ +public class GearPipeline implements VisionPipeline { + + // Outputs + private Mat rgbThresholdOutput = new Mat(); + private ArrayList findContoursOutput = new ArrayList(); + private ArrayList filterContoursOutput = new ArrayList(); + + static { + System.loadLibrary(Core.NATIVE_LIBRARY_NAME); + } + + /** + * This is the primary method that runs the entire pipeline and updates the + * outputs. + */ + @Override + public void process(Mat source0) { + // Step RGB_Threshold0: + Mat rgbThresholdInput = source0; + double[] rgbThresholdRed = { 0.0, 255.0 }; + double[] rgbThresholdGreen = { 130.71043165467623, 255.0 }; + double[] rgbThresholdBlue = { 0.0, 255.0 }; + rgbThreshold(rgbThresholdInput, rgbThresholdRed, rgbThresholdGreen, rgbThresholdBlue, rgbThresholdOutput); + + // Step Find_Contours0: + Mat findContoursInput = rgbThresholdOutput; + boolean findContoursExternalOnly = false; + findContours(findContoursInput, findContoursExternalOnly, findContoursOutput); + + // Step Filter_Contours0: + ArrayList filterContoursContours = findContoursOutput; + double filterContoursMinArea = 500.0; + double filterContoursMinPerimeter = 100.0; + double filterContoursMinWidth = 0.0; + double filterContoursMaxWidth = 1000.0; + double filterContoursMinHeight = 0.0; + double filterContoursMaxHeight = 1000.0; + double[] filterContoursSolidity = { 0, 100 }; + double filterContoursMaxVertices = 1000000.0; + double filterContoursMinVertices = 0.0; + double filterContoursMinRatio = 0.0; + double filterContoursMaxRatio = 1000.0; + filterContours(filterContoursContours, filterContoursMinArea, filterContoursMinPerimeter, + filterContoursMinWidth, filterContoursMaxWidth, filterContoursMinHeight, filterContoursMaxHeight, + filterContoursSolidity, filterContoursMaxVertices, filterContoursMinVertices, filterContoursMinRatio, + filterContoursMaxRatio, filterContoursOutput); + + } + + /** + * This method is a generated getter for the output of a RGB_Threshold. + * + * @return Mat output from RGB_Threshold. + */ + public Mat rgbThresholdOutput() { + return rgbThresholdOutput; + } + + /** + * This method is a generated getter for the output of a Find_Contours. + * + * @return ArrayList output from Find_Contours. + */ + public ArrayList findContoursOutput() { + return findContoursOutput; + } + + /** + * This method is a generated getter for the output of a Filter_Contours. + * + * @return ArrayList output from Filter_Contours. + */ + public ArrayList filterContoursOutput() { + return filterContoursOutput; + } + + /** + * Segment an image based on color ranges. + * + * @param input + * The image on which to perform the RGB threshold. + * @param red + * The min and max red. + * @param green + * The min and max green. + * @param blue + * The min and max blue. + * @param output + * The image in which to store the output. + */ + private void rgbThreshold(Mat input, double[] red, double[] green, double[] blue, Mat out) { + Imgproc.cvtColor(input, out, Imgproc.COLOR_BGR2RGB); + Core.inRange(out, new Scalar(red[0], green[0], blue[0]), new Scalar(red[1], green[1], blue[1]), out); + } + + /** + * Sets the values of pixels in a binary image to their distance to the + * nearest black pixel. + * + * @param input + * The image on which to perform the Distance Transform. + * @param type + * The Transform. + * @param maskSize + * the size of the mask. + * @param output + * The image in which to store the output. + */ + private void findContours(Mat input, boolean externalOnly, List contours) { + Mat hierarchy = new Mat(); + contours.clear(); + int mode; + if (externalOnly) { + mode = Imgproc.RETR_EXTERNAL; + } else { + mode = Imgproc.RETR_LIST; + } + int method = Imgproc.CHAIN_APPROX_SIMPLE; + Imgproc.findContours(input, contours, hierarchy, mode, method); + } + + /** + * Filters out contours that do not meet certain criteria. + * + * @param inputContours + * is the input list of contours + * @param output + * is the the output list of contours + * @param minArea + * is the minimum area of a contour that will be kept + * @param minPerimeter + * is the minimum perimeter of a contour that will be kept + * @param minWidth + * minimum width of a contour + * @param maxWidth + * maximum width + * @param minHeight + * minimum height + * @param maxHeight + * maximimum height + * @param Solidity + * the minimum and maximum solidity of a contour + * @param minVertexCount + * minimum vertex Count of the contours + * @param maxVertexCount + * maximum vertex Count + * @param minRatio + * minimum ratio of width to height + * @param maxRatio + * maximum ratio of width to height + */ + private void filterContours(List inputContours, double minArea, double minPerimeter, double minWidth, + double maxWidth, double minHeight, double maxHeight, double[] solidity, double maxVertexCount, + double minVertexCount, double minRatio, double maxRatio, List output) { + final MatOfInt hull = new MatOfInt(); + output.clear(); + // operation + for (int i = 0; i < inputContours.size(); i++) { + final MatOfPoint contour = inputContours.get(i); + final Rect bb = Imgproc.boundingRect(contour); + if (bb.width < minWidth || bb.width > maxWidth) + continue; + if (bb.height < minHeight || bb.height > maxHeight) + continue; + final double area = Imgproc.contourArea(contour); + if (area < minArea) + continue; + if (Imgproc.arcLength(new MatOfPoint2f(contour.toArray()), true) < minPerimeter) + continue; + Imgproc.convexHull(contour, hull); + MatOfPoint mopHull = new MatOfPoint(); + mopHull.create((int) hull.size().height, 1, CvType.CV_32SC2); + for (int j = 0; j < hull.size().height; j++) { + int index = (int) hull.get(j, 0)[0]; + double[] point = new double[] { contour.get(index, 0)[0], contour.get(index, 0)[1] }; + mopHull.put(j, 0, point); + } + final double solid = 100 * area / Imgproc.contourArea(mopHull); + if (solid < solidity[0] || solid > solidity[1]) + continue; + if (contour.rows() < minVertexCount || contour.rows() > maxVertexCount) + continue; + final double ratio = bb.width / (double) bb.height; + if (ratio < minRatio || ratio > maxRatio) + continue; + output.add(contour); + } + } + +} From a3761c6c078e14824b53e9f679228bb2a00d98f4 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:08:04 -0500 Subject: [PATCH 031/121] changes --- .../org/usfirst/frc/team3494/robot/Robot.java | 71 +++++++++++-------- .../team3494/robot/subsystems/GearTake.java | 7 +- .../team3494/robot/vision/GripPipeline.java | 11 ++- .../team3494/robot/vision/VisionUtils.java | 16 +++++ 4 files changed, 68 insertions(+), 37 deletions(-) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/VisionUtils.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index ed95184..bbfdffb 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -67,11 +67,11 @@ public class Robot extends IterativeRobot { @SuppressWarnings("unused") private static final int IMG_HEIGHT = 240; VisionThread visionThread; - public static double centerX = 0.0; - public static double absolutelyAverage = 0.0; + public double centerX = 0.0; + public double absolutelyAverage = 0.0; @SuppressWarnings("unused") private ArrayList filteredContours; - private ArrayList averages; + private ArrayList averages = new ArrayList(); private final Object imgLock = new Object(); @@ -93,40 +93,48 @@ public void robotInit() { ahrs = new AHRS(SerialPort.Port.kMXP); // Auto programs come after all subsystems are created chooser.addDefault("To the baseline!", new ConstructedAuto(AutoGenerator.crossBaseLine())); - chooser.addObject("Other command", new ConstructedAuto(AutoGenerator.crossBaseLine())); + chooser.addObject("Center Gear Placer", new ConstructedAuto(AutoGenerator.placeCenterGear())); chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); // put chooser on DS - SmartDashboard.putData("Auto mode", chooser); + SmartDashboard.putData("Auto-mode", chooser); // get preferences prefs = Preferences.getInstance(); camera_0 = CameraServer.getInstance().startAutomaticCapture("Gear View", 0); - camera_1 = CameraServer.getInstance().startAutomaticCapture("Intake View", 1); + camera_0.setExposureManual(20); + // camera_1 = CameraServer.getInstance().startAutomaticCapture("Intake + // View", 1); // Create and start vision thread visionThread = new VisionThread(camera_0, new GripPipeline(), pipeline -> { if (!pipeline.filterContoursOutput().isEmpty()) { - MatOfPoint firstCont = pipeline.filterContoursOutput().get(0); - MatOfPoint secondCont = pipeline.filterContoursOutput().get(1); - double average_x_one = 0; - for (Point p : firstCont.toList()) { - average_x_one += p.x; - } - double average_x_two = 0; - for (Point p : secondCont.toList()) { - average_x_two += p.x; - } - // divide by number of points to give actual average - average_x_two = average_x_two / secondCont.toList().size(); - average_x_one = average_x_one / firstCont.toList().size(); - Rect r = Imgproc.boundingRect(pipeline.findContoursOutput().get(0)); - synchronized (imgLock) { - centerX = r.x + (r.width / 2); - absolutelyAverage = (average_x_two + average_x_one) / 2; - filteredContours = pipeline.filterContoursOutput(); - // add averages to list - averages.clear(); - averages.add(average_x_one); - averages.add(average_x_two); + if (pipeline.filterContoursOutput().size() >= 2) { + MatOfPoint firstCont = pipeline.filterContoursOutput().get(0); + MatOfPoint secondCont = pipeline.filterContoursOutput().get(1); + double average_y_one = 0; + for (Point p : firstCont.toList()) { + average_y_one += p.y; + } + double average_y_two = 0; + for (Point p : secondCont.toList()) { + average_y_two += p.y; + } + // divide by number of points to give actual average + average_y_two = average_y_two / secondCont.toList().size(); + average_y_one = average_y_one / firstCont.toList().size(); + Rect r = Imgproc.boundingRect(pipeline.findContoursOutput().get(0)); + synchronized (imgLock) { + centerX = r.x + (r.width / 2); + filteredContours = pipeline.filterContoursOutput(); + // add averages to list + averages.add(average_y_one); + averages.add(average_y_two); + } + } else { + Rect r = Imgproc.boundingRect(pipeline.findContoursOutput().get(0)); + synchronized (imgLock) { + centerX = r.x + (r.width / 2); + filteredContours = pipeline.filterContoursOutput(); + } } } }); @@ -182,11 +190,13 @@ public void autonomousPeriodic() { } else { double centerX; synchronized (imgLock) { - centerX = Robot.centerX; + centerX = this.centerX; + System.out.println("CenterX: " + this.centerX); } double turn = centerX - (Robot.IMG_WIDTH / 2); // drive with turn - driveTrain.wpiDrive.arcadeDrive(0.5, (turn * 0.005) * -1); + System.out.println("Turn: " + turn); + Robot.driveTrain.wpiDrive.arcadeDrive(0.5, (turn * 0.005) * -1); } } @@ -228,6 +238,7 @@ public void teleopPeriodic() { SmartDashboard.putNumber("Motor 15", Robot.pdp.getCurrent(15)); SmartDashboard.putNumber("Climber Motor", Robot.pdp.getCurrent(RobotMap.CLIMBER_MOTOR_PDP)); + SmartDashboard.putBoolean("line break", Robot.gearTake.lb.getBroken()); } /** diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java index 218333d..378f32b 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java @@ -1,13 +1,15 @@ package org.usfirst.frc.team3494.robot.subsystems; import org.usfirst.frc.team3494.robot.RobotMap; +import org.usfirst.frc.team3494.robot.sensors.LineBreak; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.command.Subsystem; /** - * + * Gear holder subsystem. Contains all methods for controlling the robot's gear + * holder. */ public class GearTake extends Subsystem { @@ -23,12 +25,15 @@ public class GearTake extends Subsystem { * The solenoid that holds the gear or drops it. */ private DoubleSolenoid openandclose; + + public LineBreak lb; public GearTake() { super(); this.rampenoid = new DoubleSolenoid(RobotMap.GEAR_RAMP_CHONE, RobotMap.GEAR_RAMP_CHTWO); this.openandclose = new DoubleSolenoid(RobotMap.GEAR_GRASP_CHONE, RobotMap.GEAR_GRASP_CHTWO); this.openandclose.set(Value.kReverse); + this.lb = new LineBreak(0); } @Override diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java index 9c23c2f..928dd34 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java @@ -19,8 +19,7 @@ * GripPipeline class. * *

- * An OpenCV pipeline generated by GRIP. Docs are poor at best. - *

+ * An OpenCV pipeline generated by GRIP. * * @author GRIP */ @@ -86,7 +85,7 @@ public Mat hslThresholdOutput() { /** * This method is a generated getter for the output of a Find_Contours. * - * @return ArrayList<MatOfPoint> output from Find_Contours. + * @return {@literal ArrayList} output from Find_Contours. */ public ArrayList findContoursOutput() { return findContoursOutput; @@ -95,7 +94,7 @@ public ArrayList findContoursOutput() { /** * This method is a generated getter for the output of a Filter_Contours. * - * @return ArrayList<MatOfPoint> output from Filter_Contours. + * @return {@literal ArrayList} output from Filter_Contours. */ public ArrayList filterContoursOutput() { return filterContoursOutput; @@ -112,7 +111,7 @@ public ArrayList filterContoursOutput() { * The min and max saturation * @param lum * The min and max luminance - * @param out + * @param output * The image in which to store the output. */ private void hslThreshold(Mat input, double[] hue, double[] sat, double[] lum, Mat out) { @@ -165,7 +164,7 @@ private void findContours(Mat input, boolean externalOnly, List cont * minimum height * @param maxHeight * maximimum height - * @param solidity + * @param Solidity * the minimum and maximum solidity of a contour * @param minVertexCount * minimum vertex Count of the contours diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/VisionUtils.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/VisionUtils.java new file mode 100644 index 0000000..d48b41f --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/VisionUtils.java @@ -0,0 +1,16 @@ +package org.usfirst.frc.team3494.robot.vision; + +import org.opencv.core.Mat; +import org.opencv.core.Point; +import org.opencv.imgproc.Imgproc; + +public class VisionUtils { + public static Mat rotate(Mat source, double angle) { + // Step rotate_image + Point src_center = new Point(source.cols() / 2.0F, source.rows() / 2.0F); + Mat rot_mat = Imgproc.getRotationMatrix2D(src_center, 180, 1.0); + Mat dst = new Mat(); + Imgproc.warpAffine(source, dst, rot_mat, source.size()); + return dst; + } +} From 89533ae102407074dc07c6181c1529c9aadc68ac Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 20:47:42 -0500 Subject: [PATCH 032/121] Format source --- .../robot/commands/auto/StageTest.java | 65 ++++++++++--------- .../frc/team3494/robot/sensors/LineBreak.java | 3 + .../team3494/robot/subsystems/GearTake.java | 2 +- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java index da69c33..c5cd5c1 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java @@ -9,36 +9,37 @@ */ public class StageTest extends Command { private int counter; - public StageTest() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.driveTrain); - } - - // Called just before this Command runs the first time - protected void initialize() { - Robot.driveTrain.initStaging(); - Robot.driveTrain.stagedTankDrive(-0.4, 0.4); - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - this.counter++; - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return counter > 100; - } - - // Called once after isFinished returns true - protected void end() { - Robot.driveTrain.snapBackToReality(); - Robot.driveTrain.setAll(0); - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } + + public StageTest() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.driveTrain); + } + + // Called just before this Command runs the first time + protected void initialize() { + Robot.driveTrain.initStaging(); + Robot.driveTrain.stagedTankDrive(-0.4, 0.4); + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + this.counter++; + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return counter > 100; + } + + // Called once after isFinished returns true + protected void end() { + Robot.driveTrain.snapBackToReality(); + Robot.driveTrain.setAll(0); + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java index a91294a..e7ee28c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java @@ -12,14 +12,17 @@ public class LineBreak { * Analog trigger object. */ private AnalogTrigger trigger1; + public LineBreak(int channel) { this.ai1 = new AnalogInput(channel); this.trigger1 = new AnalogTrigger(ai1); this.trigger1.setLimitsVoltage(0.777, 3.703); } + public LineBreak() { this(1); } + /** * Returns true if the trigger is broken. */ diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java index 378f32b..307c45b 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java @@ -25,7 +25,7 @@ public class GearTake extends Subsystem { * The solenoid that holds the gear or drops it. */ private DoubleSolenoid openandclose; - + public LineBreak lb; public GearTake() { From fff72c18495e5db1063f4b8ef774cec74b27c310 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 10 Mar 2017 21:01:26 -0500 Subject: [PATCH 033/121] Refactor SetGearPosition to Toggle --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 8 ++++---- .../{SetGearPosition.java => ToggleGearPosition.java} | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) rename 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/{SetGearPosition.java => ToggleGearPosition.java} (93%) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index e7231af..5fc8b05 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -5,7 +5,7 @@ import org.usfirst.frc.team3494.robot.commands.auto.AngleTurn; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; -import org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition; +import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; import edu.wpi.first.wpilibj.command.Command; @@ -49,10 +49,10 @@ public static ArrayList crossBaseLine() { public static ArrayList placeCenterGear() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(-76, UnitTypes.INCHES)); - list.add(new SetGearPosition()); + list.add(new DistanceDrive(-109, UnitTypes.INCHES)); + list.add(new ToggleGearPosition()); list.add(new ToggleGearRamp()); - list.add(new DistanceDrive(10, UnitTypes.INCHES)); + list.add(new DistanceDrive(1, UnitTypes.INCHES)); return list; } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetGearPosition.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/ToggleGearPosition.java similarity index 93% rename from 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetGearPosition.java rename to 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/ToggleGearPosition.java index eda6f3c..e28577a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetGearPosition.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/ToggleGearPosition.java @@ -8,8 +8,8 @@ /** * Sets the gear holder position to what it is not. */ -public class SetGearPosition extends Command { - public SetGearPosition() { +public class ToggleGearPosition extends Command { + public ToggleGearPosition() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); requires(Robot.gearTake); From bc586e1df81c2c52b868e09b99db5cc649e981eb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:46:46 -0500 Subject: [PATCH 034/121] Add driver control to back off of gear peg --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index 7ffe37e..97abed7 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3494.robot; +import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.climb.Climb; import org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle; import org.usfirst.frc.team3494.robot.commands.climb.StopClimber; @@ -67,7 +68,7 @@ public class OI { public OI() { // Ready Player One - + xbox_a.whenPressed(new DistanceDrive(-12, UnitTypes.INCHES)); // Ready Player Two // Climb controls xbox_a_2.whileActive(new Climb(DriveDirections.UP)); From 7ab3f74c8611600b6a701bb8e7036d86055c588d Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:47:03 -0500 Subject: [PATCH 035/121] Lower distance drive speed --- .../team3494/robot/commands/auto/DistanceDrive.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index 4c00aee..2eed187 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -44,10 +44,10 @@ protected void initialize() { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - if (this.dist > Robot.driveTrain.getRightDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(0.4, 0.4); - } else if (this.dist < Robot.driveTrain.getRightDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(-0.4, -0.4); + if (this.dist > Robot.driveTrain.getAvgDistance(this.unit)) { + Robot.driveTrain.adjustedTankDrive(0.3, 0.3); + } else if (this.dist < Robot.driveTrain.getAvgDistance(this.unit)) { + Robot.driveTrain.adjustedTankDrive(-0.3, -0.3); } else { return; } @@ -59,9 +59,9 @@ protected void execute() { protected boolean isFinished() { boolean isDone; if (this.dist < 0) { - isDone = Robot.driveTrain.getRightDistance(this.unit) < this.dist; + isDone = Robot.driveTrain.getAvgDistance(this.unit) <= this.dist; } else { - isDone = Robot.driveTrain.getRightDistance(this.unit) > this.dist; + isDone = Robot.driveTrain.getAvgDistance(this.unit) >= this.dist; } return isDone; } From db1d7780055d8ed9d39de2df4acc6de957bf8b25 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:47:36 -0500 Subject: [PATCH 036/121] Actually make ramp go in on climber toggle --- .../frc/team3494/robot/commands/climb/ClimberToggle.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java index ba580f7..eb532b0 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.java @@ -29,11 +29,12 @@ protected void execute() { if (!Robot.climber.getState()) { Robot.climber.engagePTO(); Robot.kompressor.compress.stop(); - Robot.gearTake.setRamp(Value.kReverse); + Robot.gearTake.setRamp(Value.kForward); Robot.gearTake.setGrasp(Value.kForward); } else { Robot.climber.disengagePTO(); Robot.kompressor.compress.start(); + Robot.gearTake.setGrasp(Value.kReverse); } } From 2c7c365ebb9861dcde9ca0cc9c8ed0d081bb18c8 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:47:51 -0500 Subject: [PATCH 037/121] Fix inversion issue --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index ee0a7b1..e165b93 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -70,8 +70,8 @@ public class Drivetrain extends Subsystem implements IMotorizedSubsystem { private static double RAMP = 48; - public int inverter = 1; - public double scaleDown = -1; + public int inverter = -1; + public double scaleDown = 1; private CANTalon[] leftSide; private CANTalon[] rightSide; From 60b43dd7d47678c2e71dd11f8baf65691899fb48 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:48:03 -0500 Subject: [PATCH 038/121] See previous --- .../org/usfirst/frc/team3494/robot/commands/drive/Drive.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index e55c88c..86e2b12 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -48,11 +48,11 @@ protected void execute() { if (Robot.driveTrain.getInverted()) { Robot.driveTrain.wpiDrive.arcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - -Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); + Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); } else { Robot.driveTrain.wpiDrive.arcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); + -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); } } else { if (!Robot.driveTrain.getInverted()) { From 8545bee7f70b237bdd5ba0198c49af199a6af6fc Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:48:17 -0500 Subject: [PATCH 039/121] Creat an auto program to do nothing --- .../robot/commands/auto/NullAuto.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java new file mode 100644 index 0000000..b2fb2ff --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java @@ -0,0 +1,37 @@ +package org.usfirst.frc.team3494.robot.commands.auto; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * an auto program that does nothing + */ +public class NullAuto extends Command { + + public NullAuto() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + System.out.println("i am doing nothing"); + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } +} From 6a84bce7567edf2230e223d70e3afbbdfb0ffed3 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 11 Mar 2017 11:48:30 -0500 Subject: [PATCH 040/121] Use NullAuto --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index bbfdffb..aa427fa 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -7,6 +7,7 @@ import org.opencv.core.Rect; import org.opencv.imgproc.Imgproc; import org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto; +import org.usfirst.frc.team3494.robot.commands.auto.NullAuto; import org.usfirst.frc.team3494.robot.commands.auto.StageTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; @@ -96,8 +97,10 @@ public void robotInit() { chooser.addObject("Center Gear Placer", new ConstructedAuto(AutoGenerator.placeCenterGear())); chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); + chooser.addObject("Do nothing", new NullAuto()); // put chooser on DS - SmartDashboard.putData("Auto-mode", chooser); + String dataKey = "AutoChooser"; + SmartDashboard.putData(dataKey, chooser); // get preferences prefs = Preferences.getInstance(); camera_0 = CameraServer.getInstance().startAutomaticCapture("Gear View", 0); From 8e6ee5bde67e2f47a266deedad7eb762e55904aa Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:49:34 -0400 Subject: [PATCH 041/121] Format source --- .../robot/commands/auto/NullAuto.java | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java index b2fb2ff..beedcbb 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.java @@ -7,31 +7,36 @@ */ public class NullAuto extends Command { - public NullAuto() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - } - - // Called just before this Command runs the first time - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - System.out.println("i am doing nothing"); - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return false; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } + public NullAuto() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + System.out.println("i am doing nothing"); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } } From 0fb7bd10144b59ccb681f3e6d328db604e58384a Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:52:11 -0400 Subject: [PATCH 042/121] Compensate for left side --- .../frc/team3494/robot/commands/auto/DistanceDrive.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index 2eed187..8e76ec9 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -39,19 +39,20 @@ public DistanceDrive(double distance, UnitTypes unitType) { protected void initialize() { Robot.driveTrain.resetRight(); Robot.driveTrain.resetLeft(); + System.out.println("Driving " + this.dist + " " + this.unit.toString() + "(s)"); } // Called repeatedly when this Command is scheduled to run @Override protected void execute() { if (this.dist > Robot.driveTrain.getAvgDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(0.3, 0.3); + Robot.driveTrain.adjustedTankDrive(0.185, 0.2); } else if (this.dist < Robot.driveTrain.getAvgDistance(this.unit)) { - Robot.driveTrain.adjustedTankDrive(-0.3, -0.3); + Robot.driveTrain.adjustedTankDrive(-0.185, -0.2); } else { return; } - System.out.println(Robot.driveTrain.getAvgDistance(this.unit)); + System.out.println("Average distance: " + Robot.driveTrain.getAvgDistance(this.unit)); } // Make this return true when this Command no longer needs to run execute() From 35ff283ee9d930924b716c31644c87bb5ba4af8b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:52:23 -0400 Subject: [PATCH 043/121] Learn about PID --- .../robot/commands/auto/PIDAngleDrive.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java new file mode 100644 index 0000000..1cfc526 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java @@ -0,0 +1,58 @@ +package org.usfirst.frc.team3494.robot.commands.auto; + +import org.usfirst.frc.team3494.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; + +/** + * Turns the robot to an angle using PID. Hello, PID. + */ +public class PIDAngleDrive extends Command { + + private double angle; + + public PIDAngleDrive(double angle) { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.driveTrain); + this.angle = angle; + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + Robot.ahrs.reset(); + Robot.driveTrain.enable(); + Robot.driveTrain.setSetpoint(this.angle); + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); + System.out.println(Robot.ahrs.getAngle()); + // System.out.println(Robot.driveTrain.PIDTune); + Robot.driveTrain.wpiDrive.arcadeDrive(0, Robot.driveTrain.PIDTune); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return Robot.driveTrain.onTarget(); + } + + // Called once after isFinished returns true + @Override + protected void end() { + Robot.driveTrain.disable(); + Robot.driveTrain.stopAll(); + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + end(); + } +} From 9713da531bbd461499be072d897ae37455a60ccd Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:52:34 -0400 Subject: [PATCH 044/121] Add missing overrides --- .../usfirst/frc/team3494/robot/commands/auto/StageTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java index c5cd5c1..7732386 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java @@ -17,22 +17,26 @@ public StageTest() { } // Called just before this Command runs the first time + @Override protected void initialize() { Robot.driveTrain.initStaging(); Robot.driveTrain.stagedTankDrive(-0.4, 0.4); } // Called repeatedly when this Command is scheduled to run + @Override protected void execute() { this.counter++; } // Make this return true when this Command no longer needs to run execute() + @Override protected boolean isFinished() { return counter > 100; } // Called once after isFinished returns true + @Override protected void end() { Robot.driveTrain.snapBackToReality(); Robot.driveTrain.setAll(0); @@ -40,6 +44,7 @@ protected void end() { // Called when another command which requires one or more of the same // subsystems is scheduled to run + @Override protected void interrupted() { } } From 049a7e8e6c3a8570bec6fc6f10d80d756a50b46e Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:52:54 -0400 Subject: [PATCH 045/121] Put Auto diagnostics --- .../src/org/usfirst/frc/team3494/robot/Robot.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index aa427fa..905f8d8 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -201,6 +201,19 @@ public void autonomousPeriodic() { System.out.println("Turn: " + turn); Robot.driveTrain.wpiDrive.arcadeDrive(0.5, (turn * 0.005) * -1); } + SmartDashboard.putNumber("[left] distance", Robot.driveTrain.getLeftDistance(UnitTypes.RAWCOUNT)); + SmartDashboard.putNumber("[left] distance inches", Robot.driveTrain.getLeftDistance(UnitTypes.INCHES)); + + SmartDashboard.putNumber("[right] distance", Robot.driveTrain.getRightDistance(UnitTypes.RAWCOUNT)); + SmartDashboard.putNumber("[right] distance inches", Robot.driveTrain.getRightDistance(UnitTypes.INCHES)); + + SmartDashboard.putNumber("Motor 0", Robot.pdp.getCurrent(0)); + SmartDashboard.putNumber("Motor 1", Robot.pdp.getCurrent(1)); + SmartDashboard.putNumber("Motor 2", Robot.pdp.getCurrent(2)); + + SmartDashboard.putNumber("Motor 13", Robot.pdp.getCurrent(13)); + SmartDashboard.putNumber("Motor 14", Robot.pdp.getCurrent(14)); + SmartDashboard.putNumber("Motor 15", Robot.pdp.getCurrent(15)); } @Override From a606838c51fa058146dd1195dc38b121d465ad4a Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:53:15 -0400 Subject: [PATCH 046/121] Add PID test to chooser --- .../src/org/usfirst/frc/team3494/robot/Robot.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 905f8d8..f3630db 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -8,6 +8,7 @@ import org.opencv.imgproc.Imgproc; import org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto; import org.usfirst.frc.team3494.robot.commands.auto.NullAuto; +import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; import org.usfirst.frc.team3494.robot.commands.auto.StageTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; @@ -98,9 +99,9 @@ public void robotInit() { chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); chooser.addObject("Do nothing", new NullAuto()); + chooser.addObject("PID Test - turn 90 degrees", new PIDAngleDrive(90)); // put chooser on DS - String dataKey = "AutoChooser"; - SmartDashboard.putData(dataKey, chooser); + SmartDashboard.putData("AUTO CHOOSER", chooser); // get preferences prefs = Preferences.getInstance(); camera_0 = CameraServer.getInstance().startAutomaticCapture("Gear View", 0); @@ -177,6 +178,7 @@ public void autonomousInit() { autonomousCommand = chooser.getSelected(); // schedule the autonomous command (example) if (autonomousCommand != null) { + System.out.println("Selected command " + chooser.getSelected().getName()); autonomousCommand.start(); } else { System.out.println("Defaulting to track the shiny"); From 9dba06db25b57e62476c2068779879cf4fa0302d Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:54:12 -0400 Subject: [PATCH 047/121] Create a command to do nothing --- .../team3494/robot/commands/DelayCommand.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java new file mode 100644 index 0000000..c2fb5a5 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java @@ -0,0 +1,50 @@ +package org.usfirst.frc.team3494.robot.commands; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * + */ +public class DelayCommand extends Command { + + double time; + + public DelayCommand(double t) { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + this.time = t; + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + try { + Thread.sleep((long) time); + } catch (InterruptedException e) { + System.out.println("HOW LONG DID YOU WAIT?!"); + e.printStackTrace(); + } + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return true; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} From 4717aa9d38bfc3d952870f35e17459b95f5a01a8 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:54:51 -0400 Subject: [PATCH 048/121] Make drivetrain a PIDSubsystem --- .../team3494/robot/subsystems/Drivetrain.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index e165b93..38aecfe 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -10,7 +10,7 @@ import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.RobotDrive; -import edu.wpi.first.wpilibj.command.Subsystem; +import edu.wpi.first.wpilibj.command.PIDSubsystem; /** * Drivetrain subsystem. Contains all methods for controlling the robot's @@ -19,7 +19,7 @@ * * @since 0.0.0 */ -public class Drivetrain extends Subsystem implements IMotorizedSubsystem { +public class Drivetrain extends PIDSubsystem implements IMotorizedSubsystem { /** * Master drive talon, left side. Setting this should set all the talons on * the left side of the drive train. @@ -76,8 +76,10 @@ public class Drivetrain extends Subsystem implements IMotorizedSubsystem { private CANTalon[] leftSide; private CANTalon[] rightSide; + public double PIDTune; + public Drivetrain() { - super("Drivetrain"); + super("Drivetrain", 0.02, 0, 0); // int maxAmps = 50; // create left talons this.driveLeftMaster = new CANTalon(RobotMap.leftTalonOne); @@ -127,6 +129,13 @@ public Drivetrain() { this.encLeft.setDistancePerPulse(1 / 360); this.encLeft.setReverseDirection(true); this.encLeft.reset(); + // PID control + this.PIDTune = 0; + double outRange = 0.5; + this.getPIDController().setInputRange(-180, 180); + this.getPIDController().setOutputRange(-outRange, outRange); + this.getPIDController().setContinuous(true); + this.getPIDController().setPercentTolerance(20); } // Put methods for controlling this subsystem // here. Call these from Commands. @@ -302,4 +311,14 @@ public void snapBackToReality() { this.driveRightFollower_One.set(this.driveRightMaster.getDeviceID()); this.driveRightFollower_Two.set(this.driveRightMaster.getDeviceID()); } + + @Override + protected double returnPIDInput() { + return Robot.ahrs.getAngle(); + } + + @Override + protected void usePIDOutput(double output) { + this.PIDTune = output; + } } From 5a35d7b44acb10d11c90472dbd764bdea349be0b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 11:55:06 -0400 Subject: [PATCH 049/121] Tweak auto codes, we're done here --- .../org/usfirst/frc/team3494/robot/AutoGenerator.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 5fc8b05..d16fa50 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -2,6 +2,7 @@ import java.util.ArrayList; +import org.usfirst.frc.team3494.robot.commands.DelayCommand; import org.usfirst.frc.team3494.robot.commands.auto.AngleTurn; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; @@ -43,16 +44,17 @@ public static ArrayList autoOne() { */ public static ArrayList crossBaseLine() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(-112, UnitTypes.INCHES)); + list.add(new DistanceDrive(-112 / 2, UnitTypes.INCHES)); return list; } public static ArrayList placeCenterGear() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(-109, UnitTypes.INCHES)); + list.add(new DistanceDrive(-111 / 2, UnitTypes.INCHES)); list.add(new ToggleGearPosition()); list.add(new ToggleGearRamp()); - list.add(new DistanceDrive(1, UnitTypes.INCHES)); + list.add(new DelayCommand(250)); + list.add(new DistanceDrive(10, UnitTypes.INCHES)); return list; } @@ -63,7 +65,7 @@ public static ArrayList gearPlaceAttempt() { double rise = 20.462; double run = 32.463; list.add(new AngleTurn(Math.toDegrees(Math.atan2(20.462, 32.463)))); - double dist = 0; + double dist = 10; dist = Math.sqrt((rise * rise) + (run * run)); list.add(new DistanceDrive(-dist, UnitTypes.INCHES)); return list; From 3315cdfc81eb7e0dc09cc01bd8a599bc5e45e3e2 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 12:22:24 -0400 Subject: [PATCH 050/121] Remove master/follower --- .../team3494/robot/subsystems/Drivetrain.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 38aecfe..b2abc9f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -92,10 +92,10 @@ public Drivetrain() { this.driveLeftFollower_Two.enableBrakeMode(true); this.driveLeftFollower_Two.setVoltageRampRate(RAMP); // master follower - this.driveLeftFollower_One.changeControlMode(CANTalon.TalonControlMode.Follower); - this.driveLeftFollower_One.set(driveLeftMaster.getDeviceID()); - this.driveLeftFollower_Two.changeControlMode(CANTalon.TalonControlMode.Follower); - this.driveLeftFollower_Two.set(driveLeftMaster.getDeviceID()); + // this.driveLeftFollower_One.changeControlMode(CANTalon.TalonControlMode.Follower); + // this.driveLeftFollower_One.set(driveLeftMaster.getDeviceID()); + // this.driveLeftFollower_Two.changeControlMode(CANTalon.TalonControlMode.Follower); + // this.driveLeftFollower_Two.set(driveLeftMaster.getDeviceID()); // create list this.leftSide = new CANTalon[] { this.driveLeftMaster, this.driveLeftFollower_One, this.driveLeftFollower_Two }; @@ -109,10 +109,10 @@ public Drivetrain() { this.driveRightFollower_Two.enableBrakeMode(true); this.driveRightFollower_Two.setVoltageRampRate(RAMP); // master follower - this.driveRightFollower_One.changeControlMode(TalonControlMode.Follower); - this.driveRightFollower_One.set(driveRightMaster.getDeviceID()); - this.driveRightFollower_Two.changeControlMode(TalonControlMode.Follower); - this.driveRightFollower_Two.set(driveRightMaster.getDeviceID()); + // this.driveRightFollower_One.changeControlMode(TalonControlMode.Follower); + // this.driveRightFollower_One.set(driveRightMaster.getDeviceID()); + // this.driveRightFollower_Two.changeControlMode(TalonControlMode.Follower); + // this.driveRightFollower_Two.set(driveRightMaster.getDeviceID()); // list time! this.rightSide = new CANTalon[] { this.driveRightMaster, this.driveRightFollower_One, this.driveLeftFollower_Two }; @@ -158,8 +158,13 @@ public void initDefaultCommand() { * between 0 and 1. */ public void TankDrive(double left, double right) { - driveLeftMaster.set(left * this.scaleDown * Robot.prefs.getDouble("left side multiplier", 1.0D)); + double leftScale = Robot.prefs.getDouble("left side multiplier", 1.0D); + driveLeftMaster.set(left * this.scaleDown * leftScale); driveRightMaster.set(right * this.scaleDown); + this.driveLeftFollower_One.set(left * this.scaleDown * leftScale); + this.driveRightFollower_One.set(right * this.scaleDown); + this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale); + this.driveRightFollower_Two.set(right * this.scaleDown); } /** From b579225ca477be08e05fe7e1523be36f27bf6a68 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 14:40:08 -0400 Subject: [PATCH 051/121] Copy/paste WPI's arcade drive function --- .../team3494/robot/subsystems/Drivetrain.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index b2abc9f..a79d68c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -183,6 +183,49 @@ public void adjustedTankDrive(double left, double right) { this.TankDrive(-left, right); } + public void ArcadeDrive(double moveValue, double rotateValue, boolean squaredInputs) { + double leftMotorSpeed; + double rightMotorSpeed; + + moveValue = limit(moveValue); + rotateValue = limit(rotateValue); + + if (squaredInputs) { + // square the inputs (while preserving the sign) to increase fine + // control + // while permitting full power + if (moveValue >= 0.0) { + moveValue = moveValue * moveValue; + } else { + moveValue = -(moveValue * moveValue); + } + if (rotateValue >= 0.0) { + rotateValue = rotateValue * rotateValue; + } else { + rotateValue = -(rotateValue * rotateValue); + } + } + + if (moveValue > 0.0) { + if (rotateValue > 0.0) { + leftMotorSpeed = moveValue - rotateValue; + rightMotorSpeed = Math.max(moveValue, rotateValue); + } else { + leftMotorSpeed = Math.max(moveValue, -rotateValue); + rightMotorSpeed = moveValue + rotateValue; + } + } else { + if (rotateValue > 0.0) { + leftMotorSpeed = -Math.max(-moveValue, rotateValue); + rightMotorSpeed = moveValue + rotateValue; + } else { + leftMotorSpeed = moveValue - rotateValue; + rightMotorSpeed = -Math.max(-moveValue, -rotateValue); + } + } + this.TankDrive(leftMotorSpeed, -rightMotorSpeed); + } + /** * Gets the distance the right encoder has counted in the specified unit. * @@ -326,4 +369,14 @@ protected double returnPIDInput() { protected void usePIDOutput(double output) { this.PIDTune = output; } + + private static double limit(double num) { + if (num > 1.0) { + return 1.0; + } + if (num < -1.0) { + return -1.0; + } + return num; + } } From 5784ef0812c698206f39384f8faabce8773cf220 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 14:40:28 -0400 Subject: [PATCH 052/121] Use own arcade function --- .../usfirst/frc/team3494/robot/commands/drive/Drive.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 86e2b12..136c63b 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -46,13 +46,13 @@ protected void execute() { SmartDashboard.putNumber("scale down", Robot.driveTrain.scaleDown); if (Robot.prefs.getBoolean("arcade", true)) { if (Robot.driveTrain.getInverted()) { - Robot.driveTrain.wpiDrive.arcadeDrive( + Robot.driveTrain.ArcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); + Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); } else { - Robot.driveTrain.wpiDrive.arcadeDrive( + Robot.driveTrain.ArcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown); + -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); } } else { if (!Robot.driveTrain.getInverted()) { From 71768d1440105ef6592c7ae90cb268fbc30e076d Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 14:40:47 -0400 Subject: [PATCH 053/121] Start on driving straight via PID --- .../robot/commands/auto/PIDStraightDrive.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java new file mode 100644 index 0000000..c4dd202 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java @@ -0,0 +1,61 @@ +package org.usfirst.frc.team3494.robot.commands.auto; + +import org.usfirst.frc.team3494.robot.Robot; +import org.usfirst.frc.team3494.robot.UnitTypes; + +import edu.wpi.first.wpilibj.command.Command; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; + +/** + * Drives straight using the drivetrain's PID loop. + */ +public class PIDStraightDrive extends Command { + + private double distance; + private double angle; + + public PIDStraightDrive(double dist, double angle) { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.driveTrain); + this.distance = dist; + } + + public PIDStraightDrive(double dist) { + this(dist, 0); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + Robot.ahrs.reset(); + Robot.driveTrain.enable(); + Robot.driveTrain.setSetpoint(this.angle); + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); + System.out.println(Robot.ahrs.getAngle()); + // System.out.println(Robot.driveTrain.PIDTune); + Robot.driveTrain.ArcadeDrive(0.4, Robot.driveTrain.PIDTune, true); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return Robot.driveTrain.getAvgDistance(UnitTypes.INCHES) >= this.distance; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} From 80204b2b2688f212b9b7b63bc99e0525b5607ba6 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 15:14:15 -0400 Subject: [PATCH 054/121] Annoy the FTAs --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index f3630db..f86cea7 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -83,6 +83,8 @@ public class Robot extends IterativeRobot { */ @Override public void robotInit() { + System.out.println("Hello FTAs, how are you doing?"); + System.out.println("Because I'm a QUADRANGLE."); chooser = new SendableChooser(); driveTrain = new Drivetrain(); climber = new Climber(); From 51b93c2209c2efe5fc0d0fec08d8223d077da44a Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:13:55 -0400 Subject: [PATCH 055/121] Set ramps coming in/out of auto --- .../src/org/usfirst/frc/team3494/robot/Robot.java | 15 +++++++++++++++ .../frc/team3494/robot/subsystems/Drivetrain.java | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index f86cea7..ef65960 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -18,6 +18,7 @@ import org.usfirst.frc.team3494.robot.subsystems.Turret; import org.usfirst.frc.team3494.robot.vision.GripPipeline; +import com.ctre.CANTalon; import com.kauailabs.navx.frc.AHRS; import edu.wpi.cscore.UsbCamera; @@ -185,6 +186,13 @@ public void autonomousInit() { } else { System.out.println("Defaulting to track the shiny"); } + // set ramps + for (CANTalon t : Robot.driveTrain.leftSide) { + t.setVoltageRampRate(0); + } + for (CANTalon t : Robot.driveTrain.rightSide) { + t.setVoltageRampRate(0); + } } /** @@ -231,6 +239,13 @@ public void teleopInit() { } camera_0.setExposureManual(50); camera_0.setWhiteBalanceAuto(); + // set ramps + for (CANTalon t : Robot.driveTrain.leftSide) { + t.setVoltageRampRate(Drivetrain.RAMP); + } + for (CANTalon t : Robot.driveTrain.rightSide) { + t.setVoltageRampRate(Drivetrain.RAMP); + } } /** diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index a79d68c..dc93022 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -68,13 +68,13 @@ public class Drivetrain extends PIDSubsystem implements IMotorizedSubsystem { private Encoder encRight; private Encoder encLeft; - private static double RAMP = 48; + public static final double RAMP = 48; public int inverter = -1; public double scaleDown = 1; - private CANTalon[] leftSide; - private CANTalon[] rightSide; + public CANTalon[] leftSide; + public CANTalon[] rightSide; public double PIDTune; From 4e8661aa29f78f28e8e910a88d8df841befe9616 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:14:07 -0400 Subject: [PATCH 056/121] Use absolute values in distance comparison --- .../frc/team3494/robot/commands/auto/PIDStraightDrive.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java index c4dd202..26d9747 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java @@ -45,7 +45,7 @@ protected void execute() { // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { - return Robot.driveTrain.getAvgDistance(UnitTypes.INCHES) >= this.distance; + return Math.abs(Robot.driveTrain.getAvgDistance(UnitTypes.INCHES)) >= Math.abs(this.distance); } // Called once after isFinished returns true From 7ac28edc182be3d9e944a2434a2204a88c257877 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:24:21 -0400 Subject: [PATCH 057/121] Write some documentation --- .../team3494/robot/commands/DelayCommand.java | 2 +- .../robot/commands/auto/PIDAngleDrive.java | 6 ++++++ .../robot/commands/auto/PIDStraightDrive.java | 18 ++++++++++++++++-- .../team3494/robot/subsystems/Drivetrain.java | 12 ++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java index c2fb5a5..a57b29f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/DelayCommand.java @@ -3,7 +3,7 @@ import edu.wpi.first.wpilibj.command.Command; /** - * + * Command to cause delays in autonomous. WIP. */ public class DelayCommand extends Command { diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java index 1cfc526..e524f56 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java @@ -12,6 +12,12 @@ public class PIDAngleDrive extends Command { private double angle; + /** + * Constructor. + * + * @param angle + * The angle to turn, in degrees. + */ public PIDAngleDrive(double angle) { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java index 26d9747..630f145 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java @@ -7,20 +7,34 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; /** - * Drives straight using the drivetrain's PID loop. + * Drives straight using the drivetrain's PID loop. Only works in inches. */ public class PIDStraightDrive extends Command { private double distance; private double angle; + /** + * Constructor. + * + * @param dist + * The distance to drive, in inches. + * @param angle + * The angle to turn to. + */ public PIDStraightDrive(double dist, double angle) { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); requires(Robot.driveTrain); this.distance = dist; } - + + /** + * Other constructor. Uses default angle of 0 degrees. + * + * @param dist + * The distance to drive in inches. + */ public PIDStraightDrive(double dist) { this(dist, 0); } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index dc93022..5da0bd0 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -183,6 +183,18 @@ public void adjustedTankDrive(double left, double right) { this.TankDrive(-left, right); } + /** + * Arcade drive implements single stick driving. This function lets you + * directly provide joystick values from any source. + * + * @param moveValue + * The value to use for forwards/backwards + * @param rotateValue + * The value to use for the rotate right/left + * @param squaredInputs + * If set, decreases the sensitivity at low speeds + * @author Worcester Polytechnic Institute + */ public void ArcadeDrive(double moveValue, double rotateValue, boolean squaredInputs) { double leftMotorSpeed; double rightMotorSpeed; From a19f059d79ef95f7bf71634e252201255ad689bc Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:31:49 -0400 Subject: [PATCH 058/121] Add a missing @return --- .../src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java index e7ee28c..cf6c18a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/sensors/LineBreak.java @@ -25,6 +25,8 @@ public LineBreak() { /** * Returns true if the trigger is broken. + * + * @return Whether or not the line is broken. */ public boolean getBroken() { if (!this.trigger1.getInWindow()) { From e37048474559ddc0196efccbd1c2cd778b53d1cf Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:32:05 -0400 Subject: [PATCH 059/121] Fix xome javadoc errors --- .../usfirst/frc/team3494/robot/vision/GearPipeline.java | 8 ++++---- .../usfirst/frc/team3494/robot/vision/GripPipeline.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java index 8b45b2d..36e8f3d 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GearPipeline.java @@ -84,7 +84,7 @@ public Mat rgbThresholdOutput() { /** * This method is a generated getter for the output of a Find_Contours. * - * @return ArrayList output from Find_Contours. + * @return ArrayList<MatOfPoint> output from Find_Contours. */ public ArrayList findContoursOutput() { return findContoursOutput; @@ -93,7 +93,7 @@ public ArrayList findContoursOutput() { /** * This method is a generated getter for the output of a Filter_Contours. * - * @return ArrayList output from Filter_Contours. + * @return ArrayList<MatOfPoint> output from Filter_Contours. */ public ArrayList filterContoursOutput() { return filterContoursOutput; @@ -110,7 +110,7 @@ public ArrayList filterContoursOutput() { * The min and max green. * @param blue * The min and max blue. - * @param output + * @param out * The image in which to store the output. */ private void rgbThreshold(Mat input, double[] red, double[] green, double[] blue, Mat out) { @@ -163,7 +163,7 @@ private void findContours(Mat input, boolean externalOnly, List cont * minimum height * @param maxHeight * maximimum height - * @param Solidity + * @param solidity * the minimum and maximum solidity of a contour * @param minVertexCount * minimum vertex Count of the contours diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java index 928dd34..87e732e 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/vision/GripPipeline.java @@ -111,7 +111,7 @@ public ArrayList filterContoursOutput() { * The min and max saturation * @param lum * The min and max luminance - * @param output + * @param out * The image in which to store the output. */ private void hslThreshold(Mat input, double[] hue, double[] sat, double[] lum, Mat out) { @@ -164,7 +164,7 @@ private void findContours(Mat input, boolean externalOnly, List cont * minimum height * @param maxHeight * maximimum height - * @param Solidity + * @param solidity * the minimum and maximum solidity of a contour * @param minVertexCount * minimum vertex Count of the contours From c3484da995f9351249080b0dd509f5311138c8b3 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:32:19 -0400 Subject: [PATCH 060/121] Rebuild javadocs --- docs/allclasses-frame.html | 13 +- docs/allclasses-noframe.html | 13 +- docs/constant-values.html | 53 +- docs/deprecated-list.html | 4 +- docs/help-doc.html | 4 +- docs/index-files/index-1.html | 24 +- docs/index-files/index-10.html | 20 +- docs/index-files/index-11.html | 8 +- docs/index-files/index-12.html | 58 +- docs/index-files/index-13.html | 63 ++- docs/index-files/index-14.html | 78 +-- docs/index-files/index-15.html | 119 ++-- docs/index-files/index-16.html | 111 ++-- docs/index-files/index-17.html | 84 ++- docs/index-files/index-18.html | 51 +- docs/index-files/index-19.html | 43 +- docs/index-files/index-2.html | 16 +- docs/index-files/index-20.html | 56 +- docs/index-files/index-21.html | 169 ++++++ docs/index-files/index-3.html | 16 +- docs/index-files/index-4.html | 32 +- docs/index-files/index-5.html | 29 +- docs/index-files/index-6.html | 22 +- docs/index-files/index-7.html | 18 +- docs/index-files/index-8.html | 52 +- docs/index-files/index-9.html | 8 +- docs/index.html | 2 +- .../frc/team3494/robot/AutoGenerator.html | 19 +- .../frc/team3494/robot/DriveDirections.html | 4 +- docs/org/usfirst/frc/team3494/robot/OI.html | 44 +- .../org/usfirst/frc/team3494/robot/Robot.html | 160 +++++- .../usfirst/frc/team3494/robot/RobotMap.html | 4 +- .../usfirst/frc/team3494/robot/UnitTypes.html | 4 +- .../robot/class-use/AutoGenerator.html | 4 +- .../robot/class-use/DriveDirections.html | 4 +- .../frc/team3494/robot/class-use/OI.html | 4 +- .../frc/team3494/robot/class-use/Robot.html | 4 +- .../team3494/robot/class-use/RobotMap.html | 4 +- .../team3494/robot/class-use/UnitTypes.html | 4 +- .../team3494/robot/commands/DelayCommand.html | 396 +++++++++++++ .../robot/commands/auto/AngleTurn.html | 4 +- .../robot/commands/auto/ConstructedAuto.html | 4 +- .../robot/commands/auto/DistanceDrive.html | 8 +- .../robot/commands/auto/NullAuto.html | 360 ++++++++++++ .../robot/commands/auto/PIDAngleDrive.html | 403 +++++++++++++ .../robot/commands/auto/PIDStraightDrive.html | 438 ++++++++++++++ .../robot/commands/auto/StageTest.html | 395 +++++++++++++ .../team3494/robot/commands/auto/XYDrive.html | 8 +- .../commands/auto/class-use/AngleTurn.html | 4 +- .../auto/class-use/ConstructedAuto.html | 4 +- .../auto/class-use/DistanceDrive.html | 4 +- .../commands/auto/class-use/NullAuto.html | 124 ++++ .../auto/class-use/PIDAngleDrive.html | 124 ++++ .../auto/class-use/PIDStraightDrive.html | 124 ++++ .../commands/auto/class-use/StageTest.html | 124 ++++ .../commands/auto/class-use/XYDrive.html | 4 +- .../robot/commands/auto/package-frame.html | 8 +- .../robot/commands/auto/package-summary.html | 26 +- .../robot/commands/auto/package-tree.html | 8 +- .../robot/commands/auto/package-use.html | 4 +- .../commands/class-use/DelayCommand.html | 124 ++++ .../team3494/robot/commands/climb/Climb.html | 4 +- .../robot/commands/climb/ClimberToggle.html | 4 +- .../robot/commands/climb/StopClimber.html | 4 +- .../robot/commands/climb/class-use/Climb.html | 4 +- .../climb/class-use/ClimberToggle.html | 4 +- .../commands/climb/class-use/StopClimber.html | 4 +- .../robot/commands/climb/package-frame.html | 4 +- .../robot/commands/climb/package-summary.html | 4 +- .../robot/commands/climb/package-tree.html | 4 +- .../robot/commands/climb/package-use.html | 4 +- .../team3494/robot/commands/drive/Drive.html | 4 +- .../robot/commands/drive/HoldDriveTrain.html | 4 +- .../robot/commands/drive/class-use/Drive.html | 4 +- .../drive/class-use/HoldDriveTrain.html | 4 +- .../robot/commands/drive/package-frame.html | 4 +- .../robot/commands/drive/package-summary.html | 4 +- .../robot/commands/drive/package-tree.html | 4 +- .../robot/commands/drive/package-use.html | 4 +- .../robot/commands/gears/HoldInState.html | 8 +- .../commands/gears/ToggleGearPosition.html | 360 ++++++++++++ .../robot/commands/gears/ToggleGearRamp.html | 8 +- .../commands/gears/class-use/HoldInState.html | 4 +- .../gears/class-use/ToggleGearPosition.html | 124 ++++ .../gears/class-use/ToggleGearRamp.html | 4 +- .../robot/commands/gears/package-frame.html | 6 +- .../robot/commands/gears/package-summary.html | 6 +- .../robot/commands/gears/package-tree.html | 6 +- .../robot/commands/gears/package-use.html | 4 +- .../robot/commands/intake/RunIntake.html | 4 +- .../robot/commands/intake/SwitchPosition.html | 4 +- .../commands/intake/class-use/RunIntake.html | 4 +- .../intake/class-use/SwitchPosition.html | 4 +- .../robot/commands/intake/package-frame.html | 4 +- .../commands/intake/package-summary.html | 4 +- .../robot/commands/intake/package-tree.html | 4 +- .../robot/commands/intake/package-use.html | 4 +- .../robot/commands/package-frame.html | 10 +- .../robot/commands/package-summary.html | 26 +- .../team3494/robot/commands/package-tree.html | 18 +- .../team3494/robot/commands/package-use.html | 4 +- .../team3494/robot/commands/turret/Shoot.html | 4 +- .../robot/commands/turret/TurretCon.html | 4 +- .../commands/turret/class-use/Shoot.html | 4 +- .../commands/turret/class-use/TurretCon.html | 4 +- .../robot/commands/turret/package-frame.html | 4 +- .../commands/turret/package-summary.html | 8 +- .../robot/commands/turret/package-tree.html | 8 +- .../robot/commands/turret/package-use.html | 4 +- .../frc/team3494/robot/package-frame.html | 4 +- .../frc/team3494/robot/package-summary.html | 4 +- .../frc/team3494/robot/package-tree.html | 4 +- .../frc/team3494/robot/package-use.html | 4 +- .../frc/team3494/robot/sensors/LineBreak.html | 345 ++++++++++++ .../robot/sensors/class-use/LineBreak.html | 164 ++++++ .../team3494/robot/sensors/package-frame.html | 20 + .../robot/sensors/package-summary.html | 151 +++++ .../team3494/robot/sensors/package-tree.html | 137 +++++ .../team3494/robot/sensors/package-use.html | 157 ++++++ .../team3494/robot/subsystems/Climber.html | 4 +- .../team3494/robot/subsystems/Conveyer.html | 4 +- .../team3494/robot/subsystems/Drivetrain.html | 244 +++++++- .../team3494/robot/subsystems/GearTake.html | 23 +- .../robot/subsystems/IMotorizedSubsystem.html | 4 +- .../frc/team3494/robot/subsystems/Intake.html | 4 +- .../team3494/robot/subsystems/Kompressor.html | 4 +- .../frc/team3494/robot/subsystems/Turret.html | 4 +- .../robot/subsystems/TurretEncoders.html | 4 +- .../robot/subsystems/class-use/Climber.html | 4 +- .../robot/subsystems/class-use/Conveyer.html | 4 +- .../subsystems/class-use/Drivetrain.html | 4 +- .../robot/subsystems/class-use/GearTake.html | 4 +- .../class-use/IMotorizedSubsystem.html | 4 +- .../robot/subsystems/class-use/Intake.html | 4 +- .../subsystems/class-use/Kompressor.html | 4 +- .../robot/subsystems/class-use/Turret.html | 4 +- .../subsystems/class-use/TurretEncoders.html | 4 +- .../robot/subsystems/package-frame.html | 4 +- .../robot/subsystems/package-summary.html | 16 +- .../robot/subsystems/package-tree.html | 18 +- .../robot/subsystems/package-use.html | 8 +- .../team3494/robot/vision/GearPipeline.html | 532 ++++++++++++++++++ .../team3494/robot/vision/GripPipeline.html | 15 +- .../team3494/robot/vision/VisionUtils.html | 273 +++++++++ .../robot/vision/class-use/GearPipeline.html | 124 ++++ .../robot/vision/class-use/GripPipeline.html | 4 +- .../robot/vision/class-use/VisionUtils.html | 124 ++++ .../team3494/robot/vision/package-frame.html | 6 +- .../robot/vision/package-summary.html | 14 +- .../team3494/robot/vision/package-tree.html | 6 +- .../team3494/robot/vision/package-use.html | 4 +- docs/overview-frame.html | 6 +- docs/overview-summary.html | 12 +- docs/overview-tree.html | 23 +- docs/package-list | 2 +- 155 files changed, 6651 insertions(+), 716 deletions(-) create mode 100644 docs/index-files/index-21.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/StageTest.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/class-use/NullAuto.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/class-use/PIDAngleDrive.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/class-use/PIDStraightDrive.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/class-use/StageTest.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/class-use/DelayCommand.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/gears/ToggleGearPosition.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/gears/class-use/ToggleGearPosition.html create mode 100644 docs/org/usfirst/frc/team3494/robot/sensors/LineBreak.html create mode 100644 docs/org/usfirst/frc/team3494/robot/sensors/class-use/LineBreak.html create mode 100644 docs/org/usfirst/frc/team3494/robot/sensors/package-frame.html create mode 100644 docs/org/usfirst/frc/team3494/robot/sensors/package-summary.html create mode 100644 docs/org/usfirst/frc/team3494/robot/sensors/package-tree.html create mode 100644 docs/org/usfirst/frc/team3494/robot/sensors/package-use.html create mode 100644 docs/org/usfirst/frc/team3494/robot/vision/GearPipeline.html create mode 100644 docs/org/usfirst/frc/team3494/robot/vision/VisionUtils.html create mode 100644 docs/org/usfirst/frc/team3494/robot/vision/class-use/GearPipeline.html create mode 100644 docs/org/usfirst/frc/team3494/robot/vision/class-use/VisionUtils.html diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index 73b5f7a..1117103 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -19,25 +19,30 @@

All Classes

  • ClimberToggle
  • ConstructedAuto
  • Conveyer
  • +
  • DelayCommand
  • DistanceDrive
  • Drive
  • DriveDirections
  • Drivetrain
  • GearTake
  • -
  • GripPipeline
  • HoldDriveTrain
  • HoldInState
  • IMotorizedSubsystem
  • Intake
  • Kompressor
  • +
  • LineBreak
  • +
  • NullAuto
  • OI
  • +
  • PIDAngleDrive
  • +
  • PIDStraightDrive
  • Robot
  • RobotMap
  • RunIntake
  • -
  • SetGearPosition
  • Shoot
  • +
  • StageTest
  • StopClimber
  • SwitchPosition
  • +
  • ToggleGearPosition
  • ToggleGearRamp
  • Turret
  • TurretCon
  • diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index d05e3bd..212694f 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -19,25 +19,30 @@

    All Classes

  • ClimberToggle
  • ConstructedAuto
  • Conveyer
  • +
  • DelayCommand
  • DistanceDrive
  • Drive
  • DriveDirections
  • Drivetrain
  • GearTake
  • -
  • GripPipeline
  • HoldDriveTrain
  • HoldInState
  • IMotorizedSubsystem
  • Intake
  • Kompressor
  • +
  • LineBreak
  • +
  • NullAuto
  • OI
  • +
  • PIDAngleDrive
  • +
  • PIDStraightDrive
  • Robot
  • RobotMap
  • RunIntake
  • -
  • SetGearPosition
  • Shoot
  • +
  • StageTest
  • StopClimber
  • SwitchPosition
  • +
  • ToggleGearPosition
  • ToggleGearRamp
  • Turret
  • TurretCon
  • diff --git a/docs/constant-values.html b/docs/constant-values.html index 4a703be..932a525 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + @@ -83,6 +83,32 @@

    org.usfirst.*

    +
      +
    • + + + + + + + + + + + + + + +
      org.usfirst.frc.team3494.robot.subsystems.Drivetrain 
      Modifier and TypeConstant FieldValue
      + +public static final doubleRAMP48.0
      +
    • +
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    A

    +
    absolutelyAverage - Variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    adjustedTankDrive(double, double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    Drives the drivetrain, with the value passed in for left inverted.
    @@ -82,8 +84,16 @@

    A

    The gyro board mounted to the RoboRIO.
    +
    ai1 - Variable in class org.usfirst.frc.team3494.robot.sensors.LineBreak
    +
    +
    Actual analog channel.
    +
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.AngleTurn
     
    +
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    +
     
    +
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.XYDrive
     
    AngleTurn - Class in org.usfirst.frc.team3494.robot.commands.auto
    @@ -94,6 +104,10 @@

    A

    Constructor.
    +
    ArcadeDrive(double, double, boolean) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    +
    +
    Arcade drive implements single stick driving.
    +
    AutoGenerator - Class in org.usfirst.frc.team3494.robot
    Class containing methods that return valid lists to pass to @@ -116,8 +130,10 @@

    A

    Test method.
    +
    averages - Variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    L

    +
    lb - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
     
    +
    leftSide - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    +
     
    leftTalonOne - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    leftTalonThree - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    leftTalonTwo - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    +
    limit(double) - Static method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    +
     
    +
    LineBreak - Class in org.usfirst.frc.team3494.robot.sensors
    +
     
    +
    LineBreak(int) - Constructor for class org.usfirst.frc.team3494.robot.sensors.LineBreak
    +
     
    +
    LineBreak() - Constructor for class org.usfirst.frc.team3494.robot.sensors.LineBreak
    +
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    M

    @@ -77,7 +77,7 @@

    M

    motor - Variable in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html index 122bf7b..97b3995 100644 --- a/docs/index-files/index-12.html +++ b/docs/index-files/index-12.html @@ -2,9 +2,9 @@ - -O-Index - + +N-Index + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -69,11 +69,17 @@
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    C

    +
    camera_0 - Static variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    +
    camera_1 - Static variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    +
    centerX - Variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    chooser - Static variable in class org.usfirst.frc.team3494.robot.Robot
     
    Climb - Class in org.usfirst.frc.team3494.robot.commands.climb
    @@ -136,12 +142,14 @@

    C

     
    CONVEYER_M - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    +
    counter - Variable in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
     
    crossBaseLine() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
    Drives to the baseline and earns us five points (hopefully.)
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    diff --git a/docs/index-files/index-20.html b/docs/index-files/index-20.html index da22431..6b5fc6b 100644 --- a/docs/index-files/index-20.html +++ b/docs/index-files/index-20.html @@ -2,9 +2,9 @@ - -X-Index - + +W-Index + @@ -12,7 +12,7 @@ + + + + + +
    + + + + + + + +
    + + +
    A C D E F G H I K L M N O P R S T U V W X  + + +

    X

    +
    +
    xbox - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_a - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_a_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_b - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_b_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_lt - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    XBOX_ONE - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    +
    xbox_rt - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_rt_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_select_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_start_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    XBOX_TWO - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    +
    xbox_x - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_x_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_y - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    xbox_y_2 - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    XYDrive - Class in org.usfirst.frc.team3494.robot.commands.auto
    +
    +
    Drives to a point relative to the robot.
    +
    +
    XYDrive(double, double) - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.XYDrive
    +
    +
    Constructor.
    +
    +
    +A C D E F G H I K L M N O P R S T U V W X 
    + +
    + + + + + + + +
    + + + + diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html index c399ed3..38104f5 100644 --- a/docs/index-files/index-3.html +++ b/docs/index-files/index-3.html @@ -2,9 +2,9 @@ - + D-Index - + @@ -69,11 +69,17 @@
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    D

    +
    DelayCommand - Class in org.usfirst.frc.team3494.robot.commands
    +
    +
    Command to cause delays in autonomous.
    +
    +
    DelayCommand(double) - Constructor for class org.usfirst.frc.team3494.robot.commands.DelayCommand
    +
     
    direction - Variable in class org.usfirst.frc.team3494.robot.commands.climb.Climb
    The direction to climb in.
    @@ -88,6 +94,8 @@

    D

     
    dist - Variable in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    +
    distance - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    DistanceDrive - Class in org.usfirst.frc.team3494.robot.commands.auto
    Drives a given distance.
    @@ -147,7 +155,7 @@

    D

    driveTrainMode - Variable in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    E

    @@ -90,19 +90,29 @@

    E

     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.NullAuto
    +
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    +
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.climb.StopClimber
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.DelayCommand
    +
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.drive.Drive
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
     
    -
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    @@ -120,19 +130,29 @@

    E

     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.NullAuto
    +
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    +
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.climb.StopClimber
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.DelayCommand
    +
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.drive.Drive
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
     
    -
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    @@ -145,7 +165,7 @@

    E

    execute() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    F

    -
    filterContours(List<MatOfPoint>, double, double, double, double, double, double, double[], double, double, double, double, List<MatOfPoint>) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
    -
    Filters out contours that do not meet certain criteria.
    -
    -
    filterContoursOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    filteredContours - Variable in class org.usfirst.frc.team3494.robot.Robot
     
    -
    filterContoursOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
    -
    This method is a generated getter for the output of a Filter_Contours.
    -
    -
    findContours(Mat, boolean, List<MatOfPoint>) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
    -
    Sets the values of pixels in a binary image to their distance to the - nearest black pixel.
    -
    -
    findContoursOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
     
    -
    findContoursOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
    -
    This method is a generated getter for the output of a Find_Contours.
    -
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    G

    @@ -87,11 +87,17 @@

    G

    gearTake - Static variable in class org.usfirst.frc.team3494.robot.Robot
     
    GearTake - Class in org.usfirst.frc.team3494.robot.subsystems
    -
     
    +
    +
    Gear holder subsystem.
    +
    GearTake() - Constructor for class org.usfirst.frc.team3494.robot.subsystems.GearTake
     
    getAvgDistance(UnitTypes) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    +
    getBroken() - Method in class org.usfirst.frc.team3494.robot.sensors.LineBreak
    +
    +
    Returns true if the trigger is broken.
    +
    getDistance(TurretEncoders) - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    getGearState() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    @@ -119,14 +125,8 @@

    G

    getState() - Method in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    -
    GripPipeline - Class in org.usfirst.frc.team3494.robot.vision
    -
    -
    GripPipeline class.
    -
    -
    GripPipeline() - Constructor for class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    H

    @@ -86,20 +86,10 @@

    H

    HoldInState() - Constructor for class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
     
    -
    hslThreshold(Mat, double[], double[], double[], Mat) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
    -
    Segment an image based on hue, saturation, and luminance ranges.
    -
    -
    hslThresholdOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
     
    -
    hslThresholdOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    -
    -
    This method is a generated getter for the output of a HSL_Threshold.
    -
    hypot - Variable in class org.usfirst.frc.team3494.robot.commands.auto.XYDrive
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    I

    +
    IMG_HEIGHT - Static variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    +
    IMG_WIDTH - Static variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    +
    imgLock - Variable in class org.usfirst.frc.team3494.robot.Robot
    +
     
    IMotorizedSubsystem - Interface in org.usfirst.frc.team3494.robot.subsystems
    Interface to apply to subsystems with motors.
    @@ -96,19 +102,29 @@

    I

     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.NullAuto
    +
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    +
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.climb.StopClimber
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.DelayCommand
    +
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.drive.Drive
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
     
    -
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    @@ -120,6 +136,8 @@

    I

     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
     
    +
    initStaging() - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    +
     
    inMotor - Variable in class org.usfirst.frc.team3494.robot.subsystems.Intake
    Talon that controls the intake.
    @@ -142,19 +160,29 @@

    I

     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.NullAuto
    +
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    +
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.climb.StopClimber
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.DelayCommand
    +
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.drive.Drive
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
     
    -
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    @@ -174,19 +202,29 @@

    I

     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.NullAuto
    +
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    +
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.climb.StopClimber
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.DelayCommand
    +
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.drive.Drive
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
     
    -
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    @@ -199,7 +237,7 @@

    I

    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    -
    A C D E F G H I K L M O P R S T U V W X  +
    A C D E F G H I K L M N O P R S T U V W X 

    K

    @@ -83,7 +83,7 @@

    K

    Kompressor() - Constructor for class org.usfirst.frc.team3494.robot.subsystems.Kompressor
     
    -A C D E F G H I K L M O P R S T U V W X 
    +A C D E F G H I K L M N O P R S T U V W X 
    diff --git a/docs/index.html b/docs/index.html index f86140e..016ba9a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":9,"i1":9,"i2":9}; +var methods = {"i0":9,"i1":9,"i2":9,"i3":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -170,6 +170,10 @@

    Method Summary

    static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command>
    gearPlaceAttempt()  + +static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> +placeCenterGear()  + + + + +
      +
    • +

      placeCenterGear

      +
      public static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> placeCenterGear()
      +
    • +
    diff --git a/docs/org/usfirst/frc/team3494/robot/DriveDirections.html b/docs/org/usfirst/frc/team3494/robot/DriveDirections.html index 8e55233..75f9433 100644 --- a/docs/org/usfirst/frc/team3494/robot/DriveDirections.html +++ b/docs/org/usfirst/frc/team3494/robot/DriveDirections.html @@ -2,9 +2,9 @@ - + DriveDirections - + diff --git a/docs/org/usfirst/frc/team3494/robot/OI.html b/docs/org/usfirst/frc/team3494/robot/OI.html index 5bad135..e4d50d3 100644 --- a/docs/org/usfirst/frc/team3494/robot/OI.html +++ b/docs/org/usfirst/frc/team3494/robot/OI.html @@ -2,9 +2,9 @@ - + OI - + @@ -139,36 +139,44 @@

    Field Summary

    edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_b  +xbox_a_2  edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_b_2  +xbox_b  edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_lt  +xbox_b_2  edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_rt  +xbox_lt  edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_rt_2  +xbox_rt  edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_select_2  +xbox_rt_2  edu.wpi.first.wpilibj.buttons.JoystickButton -xbox_start_2  +xbox_select_2  edu.wpi.first.wpilibj.buttons.JoystickButton +xbox_start_2  + + +edu.wpi.first.wpilibj.buttons.JoystickButton xbox_x  + +edu.wpi.first.wpilibj.buttons.JoystickButton +xbox_x_2  + edu.wpi.first.wpilibj.buttons.JoystickButton xbox_y  @@ -251,6 +259,15 @@

    xbox_a

    public edu.wpi.first.wpilibj.buttons.JoystickButton xbox_a
    + + + +
      +
    • +

      xbox_a_2

      +
      public edu.wpi.first.wpilibj.buttons.JoystickButton xbox_a_2
      +
    • +
    @@ -323,6 +340,15 @@

    xbox_x

    public edu.wpi.first.wpilibj.buttons.JoystickButton xbox_x
    + + + +
      +
    • +

      xbox_x_2

      +
      public edu.wpi.first.wpilibj.buttons.JoystickButton xbox_x_2
      +
    • +
    diff --git a/docs/org/usfirst/frc/team3494/robot/Robot.html b/docs/org/usfirst/frc/team3494/robot/Robot.html index eeee29d..0e1db2b 100644 --- a/docs/org/usfirst/frc/team3494/robot/Robot.html +++ b/docs/org/usfirst/frc/team3494/robot/Robot.html @@ -2,9 +2,9 @@ - + Robot - + @@ -145,55 +145,95 @@

    Field Summary

    Field and Description +double +absolutelyAverage  + + static com.kauailabs.navx.frc.AHRS ahrs
    The gyro board mounted to the RoboRIO.
    - + (package private) edu.wpi.first.wpilibj.command.Command autonomousCommand  + +private java.util.ArrayList<java.lang.Double> +averages  + +static edu.wpi.cscore.UsbCamera +camera_0  + + +static edu.wpi.cscore.UsbCamera +camera_1  + + +double +centerX  + + static edu.wpi.first.wpilibj.smartdashboard.SendableChooser<edu.wpi.first.wpilibj.command.Command> chooser  - + static Climber climber  - + static Drivetrain driveTrain  + +private java.util.ArrayList<org.opencv.core.MatOfPoint> +filteredContours  + static GearTake gearTake  +private static int +IMG_HEIGHT  + + +private static int +IMG_WIDTH  + + +private java.lang.Object +imgLock  + + static Intake intake  - + static Kompressor kompressor  - + static OI oi  - + static edu.wpi.first.wpilibj.PowerDistributionPanel pdp  - + static edu.wpi.first.wpilibj.Preferences prefs  - + static Turret turret  + +(package private) edu.wpi.first.wpilibj.vision.VisionThread +visionThread  +
    • @@ -422,12 +462,110 @@

      chooser

      -
        +
        • prefs

          public static edu.wpi.first.wpilibj.Preferences prefs
        + + + +
          +
        • +

          camera_0

          +
          public static edu.wpi.cscore.UsbCamera camera_0
          +
        • +
        + + + +
          +
        • +

          camera_1

          +
          public static edu.wpi.cscore.UsbCamera camera_1
          +
        • +
        + + + + + + + + + + + +
          +
        • +

          visionThread

          +
          edu.wpi.first.wpilibj.vision.VisionThread visionThread
          +
        • +
        + + + +
          +
        • +

          centerX

          +
          public double centerX
          +
        • +
        + + + +
          +
        • +

          absolutelyAverage

          +
          public double absolutelyAverage
          +
        • +
        + + + +
          +
        • +

          filteredContours

          +
          private java.util.ArrayList<org.opencv.core.MatOfPoint> filteredContours
          +
        • +
        + + + +
          +
        • +

          averages

          +
          private java.util.ArrayList<java.lang.Double> averages
          +
        • +
        + + + +
          +
        • +

          imgLock

          +
          private final java.lang.Object imgLock
          +
        • +
      diff --git a/docs/org/usfirst/frc/team3494/robot/RobotMap.html b/docs/org/usfirst/frc/team3494/robot/RobotMap.html index 0710358..6b51788 100644 --- a/docs/org/usfirst/frc/team3494/robot/RobotMap.html +++ b/docs/org/usfirst/frc/team3494/robot/RobotMap.html @@ -2,9 +2,9 @@ - + RobotMap - + diff --git a/docs/org/usfirst/frc/team3494/robot/UnitTypes.html b/docs/org/usfirst/frc/team3494/robot/UnitTypes.html index 78253fd..5083b2b 100644 --- a/docs/org/usfirst/frc/team3494/robot/UnitTypes.html +++ b/docs/org/usfirst/frc/team3494/robot/UnitTypes.html @@ -2,9 +2,9 @@ - + UnitTypes - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html b/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html index 8a15c0a..58e85de 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.AutoGenerator - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html b/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html index aa6927f..f14e72e 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.DriveDirections - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/OI.html b/docs/org/usfirst/frc/team3494/robot/class-use/OI.html index 5c629ee..e0bdb8d 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/OI.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/OI.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.OI - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html b/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html index 82a2bc1..077dc7e 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.Robot - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html b/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html index 48c514c..4482518 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.RobotMap - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html b/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html index 20ef993..8050a00 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.UnitTypes - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html b/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html new file mode 100644 index 0000000..7a6b7d3 --- /dev/null +++ b/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html @@ -0,0 +1,396 @@ + + + + + +DelayCommand + + + + + + + + + + + + +
      +
      org.usfirst.frc.team3494.robot.commands
      +

      Class DelayCommand

      +
      +
      +
        +
      • java.lang.Object
      • +
      • +
          +
        • edu.wpi.first.wpilibj.command.Command
        • +
        • +
            +
          • org.usfirst.frc.team3494.robot.commands.DelayCommand
          • +
          +
        • +
        +
      • +
      +
      +
        +
      • +
        +
        All Implemented Interfaces:
        +
        edu.wpi.first.wpilibj.NamedSendable, edu.wpi.first.wpilibj.Sendable
        +
        +
        +
        +
        public class DelayCommand
        +extends edu.wpi.first.wpilibj.command.Command
        +
        Command to cause delays in autonomous. WIP.
        +
      • +
      +
      +
      +
        +
      • + +
          +
        • + + +

          Field Summary

          + + + + + + + + + + +
          Fields 
          Modifier and TypeField and Description
          (package private) doubletime 
          +
        • +
        + +
          +
        • + + +

          Constructor Summary

          + + + + + + + + +
          Constructors 
          Constructor and Description
          DelayCommand(double t) 
          +
        • +
        + +
          +
        • + + +

          Method Summary

          + + + + + + + + + + + + + + + + + + + + + + + + + + +
          All Methods Instance Methods Concrete Methods 
          Modifier and TypeMethod and Description
          protected voidend() 
          protected voidexecute() 
          protected voidinitialize() 
          protected voidinterrupted() 
          protected booleanisFinished() 
          +
            +
          • + + +

            Methods inherited from class edu.wpi.first.wpilibj.command.Command

            +cancel, clearRequirements, doesRequire, getGroup, getName, getSmartDashboardType, getTable, initTable, isCanceled, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setRunWhenDisabled, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
          • +
          +
            +
          • + + +

            Methods inherited from class java.lang.Object

            +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
          • +
          +
        • +
        +
      • +
      +
      +
      +
        +
      • + +
          +
        • + + +

          Field Detail

          + + + +
            +
          • +

            time

            +
            double time
            +
          • +
          +
        • +
        + +
          +
        • + + +

          Constructor Detail

          + + + +
            +
          • +

            DelayCommand

            +
            public DelayCommand(double t)
            +
          • +
          +
        • +
        + +
          +
        • + + +

          Method Detail

          + + + +
            +
          • +

            initialize

            +
            protected void initialize()
            +
            +
            Overrides:
            +
            initialize in class edu.wpi.first.wpilibj.command.Command
            +
            +
          • +
          + + + +
            +
          • +

            execute

            +
            protected void execute()
            +
            +
            Overrides:
            +
            execute in class edu.wpi.first.wpilibj.command.Command
            +
            +
          • +
          + + + +
            +
          • +

            isFinished

            +
            protected boolean isFinished()
            +
            +
            Specified by:
            +
            isFinished in class edu.wpi.first.wpilibj.command.Command
            +
            +
          • +
          + + + +
            +
          • +

            end

            +
            protected void end()
            +
            +
            Overrides:
            +
            end in class edu.wpi.first.wpilibj.command.Command
            +
            +
          • +
          + + + +
            +
          • +

            interrupted

            +
            protected void interrupted()
            +
            +
            Overrides:
            +
            interrupted in class edu.wpi.first.wpilibj.command.Command
            +
            +
          • +
          +
        • +
        +
      • +
      +
      +
      + + + + + + + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html index 0446618..e921a33 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html @@ -2,9 +2,9 @@ - + AngleTurn - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html index ee1b7a4..b00bbfd 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html @@ -2,9 +2,9 @@ - + ConstructedAuto - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html index eccbc7a..5e1191b 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html @@ -2,9 +2,9 @@ - + DistanceDrive - + @@ -50,7 +50,7 @@
    • org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
    • +
    • org.usfirst.frc.team3494.robot.commands.auto.NullAuto
    • +
    • org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
    • +
    • org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    • +
    • org.usfirst.frc.team3494.robot.commands.auto.StageTest
    diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/package-use.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/package-use.html index 62ba024..33c861b 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/package-use.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package org.usfirst.frc.team3494.robot.commands.auto - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/class-use/DelayCommand.html b/docs/org/usfirst/frc/team3494/robot/commands/class-use/DelayCommand.html new file mode 100644 index 0000000..c8e97ff --- /dev/null +++ b/docs/org/usfirst/frc/team3494/robot/commands/class-use/DelayCommand.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.usfirst.frc.team3494.robot.commands.DelayCommand + + + + + + + + + + + +
    +

    Uses of Class
    org.usfirst.frc.team3494.robot.commands.DelayCommand

    +
    +
    No usage of org.usfirst.frc.team3494.robot.commands.DelayCommand
    + + + + + + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/Climb.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/Climb.html index 2fc6d7d..65a5a4a 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/Climb.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/Climb.html @@ -2,9 +2,9 @@ - + Climb - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.html index 7c3dc24..163243e 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/ClimberToggle.html @@ -2,9 +2,9 @@ - + ClimberToggle - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/StopClimber.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/StopClimber.html index 88dc187..7feed4f 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/StopClimber.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/StopClimber.html @@ -2,9 +2,9 @@ - + StopClimber - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/Climb.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/Climb.html index 82deb8c..13747a2 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/Climb.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/Climb.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.climb.Climb - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/ClimberToggle.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/ClimberToggle.html index 62df304..14a4d3b 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/ClimberToggle.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/ClimberToggle.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/StopClimber.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/StopClimber.html index 7b022f9..c7f2ba6 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/StopClimber.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/class-use/StopClimber.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.climb.StopClimber - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-frame.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-frame.html index 36060c0..7f77565 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-frame.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-frame.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.climb - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-summary.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-summary.html index 80f3a0e..ae7dc02 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-summary.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-summary.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.climb - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-tree.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-tree.html index b9f6738..b4edc5a 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-tree.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-tree.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.climb Class Hierarchy - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-use.html b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-use.html index b9a8437..7c6cd4a 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/climb/package-use.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/climb/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package org.usfirst.frc.team3494.robot.commands.climb - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/Drive.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/Drive.html index 3119406..d8b2eb4 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/Drive.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/Drive.html @@ -2,9 +2,9 @@ - + Drive - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.html index e0a910c..5cb32af 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/HoldDriveTrain.html @@ -2,9 +2,9 @@ - + HoldDriveTrain - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/Drive.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/Drive.html index 74cb6d2..d8afbeb 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/Drive.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/Drive.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.drive.Drive - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/HoldDriveTrain.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/HoldDriveTrain.html index 0423f4b..5bd250c 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/HoldDriveTrain.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/class-use/HoldDriveTrain.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-frame.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-frame.html index 4236c8b..445eb8f 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-frame.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-frame.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.drive - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-summary.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-summary.html index 169e0f9..2a4346c 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-summary.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-summary.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.drive - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-tree.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-tree.html index 84b2502..6148442 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-tree.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-tree.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.drive Class Hierarchy - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-use.html b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-use.html index f1ec827..a80f3ee 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/drive/package-use.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/drive/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package org.usfirst.frc.team3494.robot.commands.drive - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.html b/docs/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.html index 8d0569f..7ac732f 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.html @@ -2,9 +2,9 @@ - + HoldInState - + @@ -50,7 +50,7 @@

    See: Description

    -
    +
    +
      +
    • + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      DelayCommand +
      Command to cause delays in autonomous.
      +
      +
    • +
    +

    Package org.usfirst.frc.team3494.robot.commands Description

    diff --git a/docs/org/usfirst/frc/team3494/robot/commands/package-tree.html b/docs/org/usfirst/frc/team3494/robot/commands/package-tree.html index 9b4d1aa..e35997e 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/package-tree.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/package-tree.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands Class Hierarchy - + @@ -76,6 +76,20 @@

    Hierarchy For Package org.usfirst.frc.team3494.robot.commands<
  • All Packages
  • +
    +

    Class Hierarchy

    +
      +
    • java.lang.Object +
        +
      • edu.wpi.first.wpilibj.command.Command (implements edu.wpi.first.wpilibj.NamedSendable) + +
      • +
      +
    • +
    +
    diff --git a/docs/org/usfirst/frc/team3494/robot/commands/package-use.html b/docs/org/usfirst/frc/team3494/robot/commands/package-use.html index 010f53d..9288dc1 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/package-use.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package org.usfirst.frc.team3494.robot.commands - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/turret/Shoot.html b/docs/org/usfirst/frc/team3494/robot/commands/turret/Shoot.html index 0366b57..a1a34bb 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/turret/Shoot.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/turret/Shoot.html @@ -2,9 +2,9 @@ - + Shoot - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/turret/TurretCon.html b/docs/org/usfirst/frc/team3494/robot/commands/turret/TurretCon.html index bedfe65..5382ecd 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/turret/TurretCon.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/turret/TurretCon.html @@ -2,9 +2,9 @@ - + TurretCon - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/Shoot.html b/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/Shoot.html index 1f5e6df..2352f81 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/Shoot.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/Shoot.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.turret.Shoot - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/TurretCon.html b/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/TurretCon.html index 7dbbdd6..e5248cb 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/TurretCon.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/turret/class-use/TurretCon.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.commands.turret.TurretCon - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/turret/package-frame.html b/docs/org/usfirst/frc/team3494/robot/commands/turret/package-frame.html index 146514e..9408be9 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/turret/package-frame.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/turret/package-frame.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.turret - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/turret/package-summary.html b/docs/org/usfirst/frc/team3494/robot/commands/turret/package-summary.html index 7875df3..cf75d56 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/turret/package-summary.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/turret/package-summary.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.commands.turret - + @@ -44,7 +44,7 @@ @@ -139,12 +141,16 @@

    Field Summary

    Field and Description +LineBreak +lb  + + private edu.wpi.first.wpilibj.DoubleSolenoid openandclose
    The solenoid that holds the gear or drops it.
    - + private edu.wpi.first.wpilibj.DoubleSolenoid rampenoid
    The solenoid that controls the ramp on the gear intake.
    @@ -265,13 +271,22 @@

    rampenoid

    -
      +
      • openandclose

        private edu.wpi.first.wpilibj.DoubleSolenoid openandclose
        The solenoid that holds the gear or drops it.
      + + + +
    diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/IMotorizedSubsystem.html b/docs/org/usfirst/frc/team3494/robot/subsystems/IMotorizedSubsystem.html index e821af3..c4e2036 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/IMotorizedSubsystem.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/IMotorizedSubsystem.html @@ -2,9 +2,9 @@ - + IMotorizedSubsystem - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/Intake.html b/docs/org/usfirst/frc/team3494/robot/subsystems/Intake.html index 012d32d..b7f9604 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/Intake.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/Intake.html @@ -2,9 +2,9 @@ - + Intake - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/Kompressor.html b/docs/org/usfirst/frc/team3494/robot/subsystems/Kompressor.html index d392b94..83e9c82 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/Kompressor.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/Kompressor.html @@ -2,9 +2,9 @@ - + Kompressor - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/Turret.html b/docs/org/usfirst/frc/team3494/robot/subsystems/Turret.html index c104990..e361159 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/Turret.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/Turret.html @@ -2,9 +2,9 @@ - + Turret - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/TurretEncoders.html b/docs/org/usfirst/frc/team3494/robot/subsystems/TurretEncoders.html index cd02e79..285bf39 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/TurretEncoders.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/TurretEncoders.html @@ -2,9 +2,9 @@ - + TurretEncoders - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Climber.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Climber.html index 4423a56..25882cf 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Climber.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Climber.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.Climber - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Conveyer.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Conveyer.html index 84ddbed..790c639 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Conveyer.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Conveyer.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.Conveyer - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Drivetrain.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Drivetrain.html index 34d7883..780bc77 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Drivetrain.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Drivetrain.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.Drivetrain - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/GearTake.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/GearTake.html index b3251f5..2c6e505 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/GearTake.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/GearTake.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.GearTake - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/IMotorizedSubsystem.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/IMotorizedSubsystem.html index f5897b5..8a90a35 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/IMotorizedSubsystem.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/IMotorizedSubsystem.html @@ -2,9 +2,9 @@ - + Uses of Interface org.usfirst.frc.team3494.robot.subsystems.IMotorizedSubsystem - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Intake.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Intake.html index d438aa9..533590a 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Intake.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Intake.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.Intake - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Kompressor.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Kompressor.html index f71dfaf..90dd499 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Kompressor.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Kompressor.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.Kompressor - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Turret.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Turret.html index 6988aae..3049d0e 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Turret.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/Turret.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.Turret - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/TurretEncoders.html b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/TurretEncoders.html index 14db20c..0a1dccf 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/TurretEncoders.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/class-use/TurretEncoders.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.subsystems.TurretEncoders - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/package-frame.html b/docs/org/usfirst/frc/team3494/robot/subsystems/package-frame.html index 67e4bb5..211cb58 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/package-frame.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/package-frame.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.subsystems - + diff --git a/docs/org/usfirst/frc/team3494/robot/subsystems/package-summary.html b/docs/org/usfirst/frc/team3494/robot/subsystems/package-summary.html index d385263..a6ed56e 100644 --- a/docs/org/usfirst/frc/team3494/robot/subsystems/package-summary.html +++ b/docs/org/usfirst/frc/team3494/robot/subsystems/package-summary.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.subsystems - + @@ -43,8 +43,8 @@
    Author:
    GRIP
    @@ -488,8 +487,8 @@

    filterContours

    diff --git a/docs/org/usfirst/frc/team3494/robot/vision/package-summary.html b/docs/org/usfirst/frc/team3494/robot/vision/package-summary.html index 6377a0d..9d7528b 100644 --- a/docs/org/usfirst/frc/team3494/robot/vision/package-summary.html +++ b/docs/org/usfirst/frc/team3494/robot/vision/package-summary.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.vision - + @@ -83,11 +83,21 @@

    Package org.usfirst.frc.team3494.robot.vi +GearPipeline + +
    GearPipeline class.
    + + + GripPipeline
    GripPipeline class.
    + +VisionUtils +  + diff --git a/docs/org/usfirst/frc/team3494/robot/vision/package-tree.html b/docs/org/usfirst/frc/team3494/robot/vision/package-tree.html index 7d39b09..c838c82 100644 --- a/docs/org/usfirst/frc/team3494/robot/vision/package-tree.html +++ b/docs/org/usfirst/frc/team3494/robot/vision/package-tree.html @@ -2,9 +2,9 @@ - + org.usfirst.frc.team3494.robot.vision Class Hierarchy - + @@ -81,7 +81,9 @@

    Class Hierarchy

    • java.lang.Object
        +
      • org.usfirst.frc.team3494.robot.vision.GearPipeline (implements edu.wpi.first.wpilibj.vision.VisionPipeline)
      • org.usfirst.frc.team3494.robot.vision.GripPipeline (implements edu.wpi.first.wpilibj.vision.VisionPipeline)
      • +
      • org.usfirst.frc.team3494.robot.vision.VisionUtils
    diff --git a/docs/org/usfirst/frc/team3494/robot/vision/package-use.html b/docs/org/usfirst/frc/team3494/robot/vision/package-use.html index c8318fb..1dbf06a 100644 --- a/docs/org/usfirst/frc/team3494/robot/vision/package-use.html +++ b/docs/org/usfirst/frc/team3494/robot/vision/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package org.usfirst.frc.team3494.robot.vision - + diff --git a/docs/overview-frame.html b/docs/overview-frame.html index a804a52..2de53ef 100644 --- a/docs/overview-frame.html +++ b/docs/overview-frame.html @@ -2,9 +2,9 @@ - + Overview List - + @@ -21,8 +21,8 @@

    Packages

  • org.usfirst.frc.team3494.robot.commands.gears
  • org.usfirst.frc.team3494.robot.commands.intake
  • org.usfirst.frc.team3494.robot.commands.turret
  • +
  • org.usfirst.frc.team3494.robot.sensors
  • org.usfirst.frc.team3494.robot.subsystems
  • -
  • org.usfirst.frc.team3494.robot.vision
  •  

    diff --git a/docs/overview-summary.html b/docs/overview-summary.html index 8457b33..88cf343 100644 --- a/docs/overview-summary.html +++ b/docs/overview-summary.html @@ -2,9 +2,9 @@ - + Overview - + @@ -121,11 +121,13 @@ -org.usfirst.frc.team3494.robot.subsystems -  +org.usfirst.frc.team3494.robot.sensors + +
    Package for sensor type classes.
    + -org.usfirst.frc.team3494.robot.vision +org.usfirst.frc.team3494.robot.subsystems   diff --git a/docs/overview-tree.html b/docs/overview-tree.html index c7d77a0..357f66b 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -2,9 +2,9 @@ - + Class Hierarchy - + @@ -81,8 +81,8 @@

    Hierarchy For All Packages

  • org.usfirst.frc.team3494.robot.commands.gears,
  • org.usfirst.frc.team3494.robot.commands.intake,
  • org.usfirst.frc.team3494.robot.commands.turret,
  • -
  • org.usfirst.frc.team3494.robot.subsystems,
  • -
  • org.usfirst.frc.team3494.robot.vision
  • +
  • org.usfirst.frc.team3494.robot.sensors,
  • +
  • org.usfirst.frc.team3494.robot.subsystems
  • @@ -102,20 +102,25 @@

    Class Hierarchy

  • org.usfirst.frc.team3494.robot.commands.auto.XYDrive
  • +
  • org.usfirst.frc.team3494.robot.commands.DelayCommand
  • org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
  • org.usfirst.frc.team3494.robot.commands.drive.Drive
  • org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
  • org.usfirst.frc.team3494.robot.commands.gears.HoldInState
  • +
  • org.usfirst.frc.team3494.robot.commands.auto.NullAuto
  • +
  • org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
  • +
  • org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
  • org.usfirst.frc.team3494.robot.commands.intake.RunIntake
  • -
  • org.usfirst.frc.team3494.robot.commands.gears.SetGearPosition
  • org.usfirst.frc.team3494.robot.commands.turret.Shoot
  • +
  • org.usfirst.frc.team3494.robot.commands.auto.StageTest
  • org.usfirst.frc.team3494.robot.commands.climb.StopClimber
  • org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
  • +
  • org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
  • org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
  • org.usfirst.frc.team3494.robot.commands.turret.TurretCon
  • -
  • org.usfirst.frc.team3494.robot.vision.GripPipeline (implements edu.wpi.first.wpilibj.vision.VisionPipeline)
  • +
  • org.usfirst.frc.team3494.robot.sensors.LineBreak
  • org.usfirst.frc.team3494.robot.OI
  • edu.wpi.first.wpilibj.RobotBase
      @@ -131,10 +136,14 @@

      Class Hierarchy

      • org.usfirst.frc.team3494.robot.subsystems.Climber (implements org.usfirst.frc.team3494.robot.subsystems.IMotorizedSubsystem)
      • org.usfirst.frc.team3494.robot.subsystems.Conveyer (implements org.usfirst.frc.team3494.robot.subsystems.IMotorizedSubsystem)
      • -
      • org.usfirst.frc.team3494.robot.subsystems.Drivetrain (implements org.usfirst.frc.team3494.robot.subsystems.IMotorizedSubsystem)
      • org.usfirst.frc.team3494.robot.subsystems.GearTake
      • org.usfirst.frc.team3494.robot.subsystems.Intake (implements org.usfirst.frc.team3494.robot.subsystems.IMotorizedSubsystem)
      • org.usfirst.frc.team3494.robot.subsystems.Kompressor
      • +
      • edu.wpi.first.wpilibj.command.PIDSubsystem (implements edu.wpi.first.wpilibj.Sendable) + +
      • org.usfirst.frc.team3494.robot.subsystems.Turret (implements org.usfirst.frc.team3494.robot.subsystems.IMotorizedSubsystem)
      diff --git a/docs/package-list b/docs/package-list index 6543d1e..979ffdc 100644 --- a/docs/package-list +++ b/docs/package-list @@ -6,5 +6,5 @@ org.usfirst.frc.team3494.robot.commands.drive org.usfirst.frc.team3494.robot.commands.gears org.usfirst.frc.team3494.robot.commands.intake org.usfirst.frc.team3494.robot.commands.turret +org.usfirst.frc.team3494.robot.sensors org.usfirst.frc.team3494.robot.subsystems -org.usfirst.frc.team3494.robot.vision From af48f4ca614cc65987875ba716f01483020e2cfb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:36:13 -0400 Subject: [PATCH 061/121] Rename PIDStraightDrive to PIDFullDrive --- .../commands/auto/{PIDStraightDrive.java => PIDFullDrive.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/{PIDStraightDrive.java => PIDFullDrive.java} (100%) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java similarity index 100% rename from 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDStraightDrive.java rename to 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java From ba7146575fe560bfe16d4b88d055feceaa2ba722 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:37:02 -0400 Subject: [PATCH 062/121] Futher rafactor --- .../frc/team3494/robot/commands/auto/PIDFullDrive.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index 630f145..e1bf2fa 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -9,7 +9,7 @@ /** * Drives straight using the drivetrain's PID loop. Only works in inches. */ -public class PIDStraightDrive extends Command { +public class PIDFullDrive extends Command { private double distance; private double angle; @@ -22,7 +22,7 @@ public class PIDStraightDrive extends Command { * @param angle * The angle to turn to. */ - public PIDStraightDrive(double dist, double angle) { + public PIDFullDrive(double dist, double angle) { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); requires(Robot.driveTrain); @@ -35,7 +35,7 @@ public PIDStraightDrive(double dist, double angle) { * @param dist * The distance to drive in inches. */ - public PIDStraightDrive(double dist) { + public PIDFullDrive(double dist) { this(dist, 0); } From d4c58daff2a7ea5631cf90f01759810fb0efa215 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 16:37:16 -0400 Subject: [PATCH 063/121] Add a test for PIDFullDrive --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index ef65960..7f8343a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -9,6 +9,7 @@ import org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto; import org.usfirst.frc.team3494.robot.commands.auto.NullAuto; import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; +import org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive; import org.usfirst.frc.team3494.robot.commands.auto.StageTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; @@ -103,6 +104,7 @@ public void robotInit() { chooser.addObject("Follow the shiny", null); chooser.addObject("Do nothing", new NullAuto()); chooser.addObject("PID Test - turn 90 degrees", new PIDAngleDrive(90)); + chooser.addObject("PID Test - drive straight", new PIDFullDrive(12)); // put chooser on DS SmartDashboard.putData("AUTO CHOOSER", chooser); // get preferences From 5464aa3a7729cf3429cb2485df8d87efb26b9c4e Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 17:55:40 -0400 Subject: [PATCH 064/121] Add flight stick drive --- .../team3494/robot/commands/drive/Drive.java | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 136c63b..0346667 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -44,24 +44,31 @@ protected void execute() { } SmartDashboard.putNumber("inverter", Robot.driveTrain.inverter); SmartDashboard.putNumber("scale down", Robot.driveTrain.scaleDown); - if (Robot.prefs.getBoolean("arcade", true)) { - if (Robot.driveTrain.getInverted()) { - Robot.driveTrain.ArcadeDrive( - Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); + boolean useX = Robot.prefs.getBoolean("usexbox", true); + if (useX) { + if (Robot.prefs.getBoolean("arcade", true)) { + if (Robot.driveTrain.getInverted()) { + Robot.driveTrain.ArcadeDrive( + Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + true); + } else { + Robot.driveTrain.ArcadeDrive( + Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + true); + } } else { - Robot.driveTrain.ArcadeDrive( - Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); + if (!Robot.driveTrain.getInverted()) { + Robot.driveTrain.adjustedTankDrive(-Robot.oi.xbox.getY(Hand.kRight) * Robot.driveTrain.inverter, + -Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter); + } else { + Robot.driveTrain.adjustedTankDrive(-Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter, + -Robot.oi.xbox.getY(Hand.kRight) * Robot.driveTrain.inverter); + } } } else { - if (!Robot.driveTrain.getInverted()) { - Robot.driveTrain.adjustedTankDrive(-Robot.oi.xbox.getY(Hand.kRight) * Robot.driveTrain.inverter, - -Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter); - } else { - Robot.driveTrain.adjustedTankDrive(-Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter, - -Robot.oi.xbox.getY(Hand.kRight) * Robot.driveTrain.inverter); - } + Robot.driveTrain.TankDrive(-Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); } } From a844ca6579d5c7b3aa189818d523841f48da5b91 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 17:55:55 -0400 Subject: [PATCH 065/121] Tune PID, just a little bit --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 5da0bd0..928d97b 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -79,7 +79,7 @@ public class Drivetrain extends PIDSubsystem implements IMotorizedSubsystem { public double PIDTune; public Drivetrain() { - super("Drivetrain", 0.02, 0, 0); + super("Drivetrain", 0.0035, 0, 0); // int maxAmps = 50; // create left talons this.driveLeftMaster = new CANTalon(RobotMap.leftTalonOne); From b97aa247f0642d28228db407e241f072084b6d36 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 17:56:08 -0400 Subject: [PATCH 066/121] Tweak PID test --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 7f8343a..597f15a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -104,7 +104,7 @@ public void robotInit() { chooser.addObject("Follow the shiny", null); chooser.addObject("Do nothing", new NullAuto()); chooser.addObject("PID Test - turn 90 degrees", new PIDAngleDrive(90)); - chooser.addObject("PID Test - drive straight", new PIDFullDrive(12)); + chooser.addObject("PID Test - drive straight", new PIDFullDrive(36)); // put chooser on DS SmartDashboard.putData("AUTO CHOOSER", chooser); // get preferences @@ -191,9 +191,11 @@ public void autonomousInit() { // set ramps for (CANTalon t : Robot.driveTrain.leftSide) { t.setVoltageRampRate(0); + t.enableBrakeMode(true); } for (CANTalon t : Robot.driveTrain.rightSide) { t.setVoltageRampRate(0); + t.enableBrakeMode(true); } } From 3cde336ed41ff45d4d27bd0d614f1e88845f3295 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 17:56:26 -0400 Subject: [PATCH 067/121] Switch to own arcade method --- .../usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java index e524f56..672b235 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java @@ -39,7 +39,7 @@ protected void execute() { SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); System.out.println(Robot.ahrs.getAngle()); // System.out.println(Robot.driveTrain.PIDTune); - Robot.driveTrain.wpiDrive.arcadeDrive(0, Robot.driveTrain.PIDTune); + Robot.driveTrain.ArcadeDrive(0, Robot.driveTrain.PIDTune, true); } // Make this return true when this Command no longer needs to run execute() From cff2a24afc9715b4128ede3e8e5c49052d8d65ce Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 18 Mar 2017 17:56:38 -0400 Subject: [PATCH 068/121] Add left and right flight sticks --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index 97abed7..5f977dd 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -10,6 +10,7 @@ import org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition; import org.usfirst.frc.team3494.robot.commands.turret.Shoot; +import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj.buttons.JoystickButton; @@ -27,6 +28,8 @@ public class OI { // Button button = new JoystickButton(stick, buttonNumber); public final XboxController xbox = new XboxController(RobotMap.XBOX_ONE); public final XboxController xbox_2 = new XboxController(RobotMap.XBOX_TWO); + public final Joystick stick_l = new Joystick(3); + public final Joystick stick_r = new Joystick(4); // There are a few additional built in buttons you can use. Additionally, // by subclassing Button you can create custom triggers and bind those to // commands the same as any other Button. From a5415ecb49e0795ea99afd0873f05f0447f71692 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Tue, 21 Mar 2017 19:46:03 -0400 Subject: [PATCH 069/121] Add scaling to the right side of the drivetrain --- .../frc/team3494/robot/subsystems/Drivetrain.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 928d97b..d2ae70a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -159,12 +159,13 @@ public void initDefaultCommand() { */ public void TankDrive(double left, double right) { double leftScale = Robot.prefs.getDouble("left side multiplier", 1.0D); - driveLeftMaster.set(left * this.scaleDown * leftScale); - driveRightMaster.set(right * this.scaleDown); + double rightScale = Robot.prefs.getDouble("right side multiplier", 1.0D); + this.driveLeftMaster.set(left * this.scaleDown * leftScale); + this.driveRightMaster.set(right * this.scaleDown * rightScale); this.driveLeftFollower_One.set(left * this.scaleDown * leftScale); - this.driveRightFollower_One.set(right * this.scaleDown); + this.driveRightFollower_One.set(right * this.scaleDown * rightScale); this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale); - this.driveRightFollower_Two.set(right * this.scaleDown); + this.driveRightFollower_Two.set(right * this.scaleDown * rightScale); } /** From 48dd518a13729b97dad52fd177ed21f9dc05273b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Tue, 21 Mar 2017 20:14:11 -0400 Subject: [PATCH 070/121] Return to Halo Drive --- .../frc/team3494/robot/commands/auto/PIDFullDrive.java | 3 ++- .../usfirst/frc/team3494/robot/commands/auto/StageTest.java | 2 +- .../org/usfirst/frc/team3494/robot/commands/drive/Drive.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index e1bf2fa..167a39d 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -7,7 +7,8 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; /** - * Drives straight using the drivetrain's PID loop. Only works in inches. + * Drives straight/forward with an angle (WIP) using the drivetrain's PID loop. + * Only works in inches. */ public class PIDFullDrive extends Command { diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java index 7732386..04901c3 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java @@ -5,7 +5,7 @@ import edu.wpi.first.wpilibj.command.Command; /** - * + * Chris made me do it */ public class StageTest extends Command { private int counter; diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 0346667..7c3f583 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -50,12 +50,12 @@ protected void execute() { if (Robot.driveTrain.getInverted()) { Robot.driveTrain.ArcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); } else { Robot.driveTrain.ArcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + -Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); } } else { From e3654ba8fb63c01329fe767a54a8a71d4b8a7961 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Wed, 22 Mar 2017 15:25:15 -0400 Subject: [PATCH 071/121] Add Quadencoders to talons --- .../src/org/usfirst/frc/team3494/robot/Robot.java | 5 +++++ .../usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 597f15a..78bc538 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -246,9 +246,11 @@ public void teleopInit() { // set ramps for (CANTalon t : Robot.driveTrain.leftSide) { t.setVoltageRampRate(Drivetrain.RAMP); + t.enableBrakeMode(true); } for (CANTalon t : Robot.driveTrain.rightSide) { t.setVoltageRampRate(Drivetrain.RAMP); + t.enableBrakeMode(true); } } @@ -267,6 +269,9 @@ public void teleopPeriodic() { SmartDashboard.putNumber("[right] distance", Robot.driveTrain.getRightDistance(UnitTypes.RAWCOUNT)); SmartDashboard.putNumber("[right] distance inches", Robot.driveTrain.getRightDistance(UnitTypes.INCHES)); + + SmartDashboard.putNumber("Talon Distance Right", Robot.driveTrain.rightSide[0].getPosition()); + SmartDashboard.putNumber("Talon Distance Left", Robot.driveTrain.leftSide[0].getPosition()); SmartDashboard.putNumber("Motor 0", Robot.pdp.getCurrent(0)); SmartDashboard.putNumber("Motor 1", Robot.pdp.getCurrent(1)); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index d2ae70a..3b5abde 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -6,6 +6,7 @@ import org.usfirst.frc.team3494.robot.commands.drive.Drive; import com.ctre.CANTalon; +import com.ctre.CANTalon.FeedbackDevice; import com.ctre.CANTalon.TalonControlMode; import edu.wpi.first.wpilibj.Encoder; @@ -83,6 +84,9 @@ public Drivetrain() { // int maxAmps = 50; // create left talons this.driveLeftMaster = new CANTalon(RobotMap.leftTalonOne); + this.driveLeftMaster.setFeedbackDevice(FeedbackDevice.QuadEncoder); + this.driveLeftMaster.configEncoderCodesPerRev(360); + this.driveLeftMaster.setEncPosition(0); this.driveLeftMaster.enableBrakeMode(true); this.driveLeftMaster.setVoltageRampRate(RAMP); this.driveLeftFollower_One = new CANTalon(RobotMap.leftTalonTwo); @@ -100,6 +104,10 @@ public Drivetrain() { this.leftSide = new CANTalon[] { this.driveLeftMaster, this.driveLeftFollower_One, this.driveLeftFollower_Two }; this.driveRightMaster = new CANTalon(RobotMap.rightTalonOne); + this.driveRightMaster.setFeedbackDevice(FeedbackDevice.QuadEncoder); + this.driveRightMaster.reverseSensor(true); + this.driveRightMaster.setEncPosition(0); + this.driveRightMaster.configEncoderCodesPerRev(360); this.driveRightMaster.enableBrakeMode(true); this.driveRightMaster.setVoltageRampRate(RAMP); this.driveRightFollower_One = new CANTalon(RobotMap.rightTalonTwo); From 7a0b62f630c9561e96a28d2b86c3504b57312b2d Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Wed, 22 Mar 2017 18:05:15 -0400 Subject: [PATCH 072/121] Test talon sie speed control --- .../org/usfirst/frc/team3494/robot/Robot.java | 2 + .../robot/commands/auto/tests/SpeedTest.java | 70 +++++++++++++++++++ .../commands/auto/tests/package-info.java | 5 ++ 3 files changed, 77 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/package-info.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 78bc538..e87e389 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -11,6 +11,7 @@ import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; import org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive; import org.usfirst.frc.team3494.robot.commands.auto.StageTest; +import org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; import org.usfirst.frc.team3494.robot.subsystems.GearTake; @@ -105,6 +106,7 @@ public void robotInit() { chooser.addObject("Do nothing", new NullAuto()); chooser.addObject("PID Test - turn 90 degrees", new PIDAngleDrive(90)); chooser.addObject("PID Test - drive straight", new PIDFullDrive(36)); + chooser.addDefault("Speed test", new SpeedTest()); // put chooser on DS SmartDashboard.putData("AUTO CHOOSER", chooser); // get preferences diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java new file mode 100644 index 0000000..71099fe --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java @@ -0,0 +1,70 @@ +package org.usfirst.frc.team3494.robot.commands.auto.tests; + +import org.usfirst.frc.team3494.robot.Robot; + +import com.ctre.CANTalon; +import com.ctre.CANTalon.TalonControlMode; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * Test for CAN Talon speed mode. + */ +public class SpeedTest extends Command { + public SpeedTest() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.driveTrain); + } + + // Called just before this Command runs the first time + protected void initialize() { + for (CANTalon t : Robot.driveTrain.leftSide) { + t.changeControlMode(TalonControlMode.Speed); + t.setProfile(0); + t.setF(0); + t.setP(0.1); + t.setI(0); + t.setD(0); + } + for (CANTalon t : Robot.driveTrain.rightSide) { + t.changeControlMode(TalonControlMode.Speed); + t.setProfile(0); + t.setF(0); + t.setP(0.1); + t.setI(0); + t.setD(0); + } + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + for (CANTalon t : Robot.driveTrain.leftSide) { + t.set(1000); + } + for (CANTalon t : Robot.driveTrain.rightSide) { + t.set(-1000); + } + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return false; // ten seconds ish + } + + // Called once after isFinished returns true + protected void end() { + for (CANTalon t : Robot.driveTrain.leftSide) { + t.changeControlMode(TalonControlMode.PercentVbus); + } + for (CANTalon t : Robot.driveTrain.rightSide) { + t.changeControlMode(TalonControlMode.PercentVbus); + } + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + end(); + } +} diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/package-info.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/package-info.java new file mode 100644 index 0000000..50e52d7 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/package-info.java @@ -0,0 +1,5 @@ +/** + * Package for holding auto codes that exist solely as tests (i.e. not for + * competition purposes.) + */ +package org.usfirst.frc.team3494.robot.commands.auto.tests; \ No newline at end of file From e3e152f0a06ec3d2cd3a670a62faf1f9095f0d50 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:00:55 -0400 Subject: [PATCH 073/121] Properly end FullDrive --- .../usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index 167a39d..e510af5 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -66,11 +66,14 @@ protected boolean isFinished() { // Called once after isFinished returns true @Override protected void end() { + Robot.driveTrain.disable(); + Robot.driveTrain.stopAll(); } // Called when another command which requires one or more of the same // subsystems is scheduled to run @Override protected void interrupted() { + this.end(); } } From 3d34a590ef9921a88c35219993b92f88935f170b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:01:23 -0400 Subject: [PATCH 074/121] Use talon encoders --- .../usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 3b5abde..483ecb1 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -256,7 +256,8 @@ public void ArcadeDrive(double moveValue, double rotateValue, boolean squaredInp * unit. */ public double getRightDistance(UnitTypes unit) { - double inches = (Math.PI * 4) * (this.encRight.get() / 360); + double encCountsTalon = this.driveRightMaster.getPosition(); + double inches = (Math.PI * 4) * (encCountsTalon / 360); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -278,7 +279,8 @@ public double getRightDistance(UnitTypes unit) { * @return The distance the left encoder has counted, in the specified unit. */ public double getLeftDistance(UnitTypes unit) { - double inches = (Math.PI * 4) * (this.encLeft.get() / 360); + double talonEncDist = this.driveLeftMaster.getPosition(); + double inches = (Math.PI * 4) * (talonEncDist / 360); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -301,6 +303,7 @@ public double getAvgDistance(UnitTypes unit) { */ public void resetRight() { this.encRight.reset(); + this.driveRightMaster.setPosition(0); } /** @@ -308,6 +311,7 @@ public void resetRight() { */ public void resetLeft() { this.encLeft.reset(); + this.driveLeftMaster.setPosition(0); } @Override From 02ad5b8ab9cc3dab4b4cd647eb8118ca6577054f Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:01:46 -0400 Subject: [PATCH 075/121] Talon dist in auto and tele --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index e87e389..080213f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -229,6 +229,9 @@ public void autonomousPeriodic() { SmartDashboard.putNumber("Motor 1", Robot.pdp.getCurrent(1)); SmartDashboard.putNumber("Motor 2", Robot.pdp.getCurrent(2)); + SmartDashboard.putNumber("Talon Distance Right", Robot.driveTrain.rightSide[0].getPosition()); + SmartDashboard.putNumber("Talon Distance Left", Robot.driveTrain.leftSide[0].getPosition()); + SmartDashboard.putNumber("Motor 13", Robot.pdp.getCurrent(13)); SmartDashboard.putNumber("Motor 14", Robot.pdp.getCurrent(14)); SmartDashboard.putNumber("Motor 15", Robot.pdp.getCurrent(15)); @@ -271,7 +274,7 @@ public void teleopPeriodic() { SmartDashboard.putNumber("[right] distance", Robot.driveTrain.getRightDistance(UnitTypes.RAWCOUNT)); SmartDashboard.putNumber("[right] distance inches", Robot.driveTrain.getRightDistance(UnitTypes.INCHES)); - + SmartDashboard.putNumber("Talon Distance Right", Robot.driveTrain.rightSide[0].getPosition()); SmartDashboard.putNumber("Talon Distance Left", Robot.driveTrain.leftSide[0].getPosition()); From c6d728c8aaa4b790ea0fc55600cf4108162d6255 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:03:15 -0400 Subject: [PATCH 076/121] that's all folks http://whatthecommit.com/08bc1a6b0b40e8f149a3a65745a13ef3 --- .../robot/commands/auto/tests/SpeedTest.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java index 71099fe..efcf5c0 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java @@ -6,6 +6,7 @@ import com.ctre.CANTalon.TalonControlMode; import edu.wpi.first.wpilibj.command.Command; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; /** * Test for CAN Talon speed mode. @@ -19,37 +20,36 @@ public SpeedTest() { // Called just before this Command runs the first time protected void initialize() { - for (CANTalon t : Robot.driveTrain.leftSide) { - t.changeControlMode(TalonControlMode.Speed); - t.setProfile(0); - t.setF(0); - t.setP(0.1); - t.setI(0); - t.setD(0); - } - for (CANTalon t : Robot.driveTrain.rightSide) { - t.changeControlMode(TalonControlMode.Speed); - t.setProfile(0); - t.setF(0); - t.setP(0.1); - t.setI(0); - t.setD(0); - } + Robot.driveTrain.leftSide[0].changeControlMode(TalonControlMode.Speed); + Robot.driveTrain.leftSide[0].setProfile(0); + Robot.driveTrain.leftSide[0].setF(0); + Robot.driveTrain.leftSide[0].setP(1); + Robot.driveTrain.leftSide[0].setI(0); + Robot.driveTrain.leftSide[0].setD(0); + + Robot.driveTrain.rightSide[0].changeControlMode(TalonControlMode.Speed); + Robot.driveTrain.rightSide[0].setProfile(0); + Robot.driveTrain.rightSide[0].setF(0); + Robot.driveTrain.rightSide[0].setP(1); + Robot.driveTrain.rightSide[0].setI(0); + Robot.driveTrain.rightSide[0].setD(0); } // Called repeatedly when this Command is scheduled to run protected void execute() { - for (CANTalon t : Robot.driveTrain.leftSide) { - t.set(1000); - } - for (CANTalon t : Robot.driveTrain.rightSide) { - t.set(-1000); - } + SmartDashboard.putNumber("left: ", Robot.driveTrain.leftSide[0].getSpeed()); + SmartDashboard.putNumber("right:", Robot.driveTrain.rightSide[0].getSpeed()); + Robot.driveTrain.leftSide[0].set(2000); + Robot.driveTrain.leftSide[1].set(0.4); + Robot.driveTrain.leftSide[2].set(0.4); + Robot.driveTrain.rightSide[0].set(-2500); + Robot.driveTrain.rightSide[1].set(-0.4); + Robot.driveTrain.rightSide[2].set(-0.4); } // Make this return true when this Command no longer needs to run execute() protected boolean isFinished() { - return false; // ten seconds ish + return false; } // Called once after isFinished returns true From a04eb000a6b5e30060f8db1635783a2c0a4def13 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:13:54 -0400 Subject: [PATCH 077/121] Refactor old GearTake to GearTake_2 --- .../src/org/usfirst/frc/team3494/robot/Robot.java | 6 +++--- .../subsystems/{GearTake.java => GearTake_2.java} | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) rename 3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/{GearTake.java => GearTake_2.java} (85%) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 080213f..1b8ec53 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -14,7 +14,7 @@ import org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; -import org.usfirst.frc.team3494.robot.subsystems.GearTake; +import org.usfirst.frc.team3494.robot.subsystems.GearTake_2; import org.usfirst.frc.team3494.robot.subsystems.Intake; import org.usfirst.frc.team3494.robot.subsystems.Kompressor; import org.usfirst.frc.team3494.robot.subsystems.Turret; @@ -52,7 +52,7 @@ public class Robot extends IterativeRobot { public static Turret turret; public static Intake intake; public static Kompressor kompressor; - public static GearTake gearTake; + public static GearTake_2 gearTake; /** * The gyro board mounted to the RoboRIO. * @@ -95,7 +95,7 @@ public void robotInit() { turret = new Turret(); kompressor = new Kompressor(); intake = new Intake(); - gearTake = new GearTake(); + gearTake = new GearTake_2(); oi = new OI(); ahrs = new AHRS(SerialPort.Port.kMXP); // Auto programs come after all subsystems are created diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java similarity index 85% rename from 3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java rename to 3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java index 307c45b..87a3586 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java @@ -11,7 +11,7 @@ * Gear holder subsystem. Contains all methods for controlling the robot's gear * holder. */ -public class GearTake extends Subsystem { +public class GearTake_2 extends Subsystem { // Put methods for controlling this subsystem // here. Call these from Commands. @@ -28,7 +28,7 @@ public class GearTake extends Subsystem { public LineBreak lb; - public GearTake() { + public GearTake_2() { super(); this.rampenoid = new DoubleSolenoid(RobotMap.GEAR_RAMP_CHONE, RobotMap.GEAR_RAMP_CHTWO); this.openandclose = new DoubleSolenoid(RobotMap.GEAR_GRASP_CHONE, RobotMap.GEAR_GRASP_CHTWO); @@ -63,14 +63,14 @@ public void setGrasp(Value value) { } /** - * Releases the gear with a call to {@link GearTake#setGrasp}. + * Releases the gear with a call to {@link GearTake_2#setGrasp}. */ public void releaseGear() { this.setGrasp(Value.kForward); } /** - * Closes the gear holder with a call to {@link GearTake#setGrasp}. + * Closes the gear holder with a call to {@link GearTake_2#setGrasp}. */ public void closeHolder() { this.setGrasp(Value.kReverse); @@ -78,7 +78,7 @@ public void closeHolder() { /** * Gets the state of the intake ramp solenoid. Equivalent to - * {@code this.rampenoid.get()}, but {@link GearTake#rampenoid} is private. + * {@code this.rampenoid.get()}, but {@link GearTake_2#rampenoid} is private. * * @return The value of {@code this.rampenoid.get()}. */ @@ -88,7 +88,7 @@ public Value getRampState() { /** * Gets the state of the gear holder. Equivalent to - * {@code this.openandclose.get()}, but {@link GearTake#openandclose} is + * {@code this.openandclose.get()}, but {@link GearTake_2#openandclose} is * private. * * @return The value of {@code this.openandclose.get()}. From cef4771cdb3547ef10f73d80c634bc8950f5b0a8 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:18:48 -0400 Subject: [PATCH 078/121] Create basic MonoGearTake subsystem --- .../usfirst/frc/team3494/robot/RobotMap.java | 3 ++ .../robot/subsystems/MonoGearTake.java | 31 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java index 397a6f3..6c58c5c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java @@ -60,4 +60,7 @@ public class RobotMap { public static final int GEAR_GRASP_CHTWO = 5; // conveyer public static final int CONVEYER_M = 14; + // single piston gear holder + public static final int MONO_GEAR_FORWARD = 10; + public static final int MONO_GEAR_REVERSE = 11; } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java new file mode 100644 index 0000000..ebe9c39 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java @@ -0,0 +1,31 @@ +package org.usfirst.frc.team3494.robot.subsystems; + +import org.usfirst.frc.team3494.robot.RobotMap; + +import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; +import edu.wpi.first.wpilibj.command.Subsystem; + +/** + * Single piston gear holder. + */ +public class MonoGearTake extends Subsystem { + + // Put methods for controlling this subsystem + // here. Call these from Commands. + private DoubleSolenoid piston; + + public void initDefaultCommand() { + // Set the default command for a subsystem here. + // setDefaultCommand(new MySpecialCommand()); + this.piston = new DoubleSolenoid(RobotMap.MONO_GEAR_FORWARD, RobotMap.MONO_GEAR_REVERSE); + } + + public void setPos(Value v) { + this.piston.set(v); + } + + public Value getPos() { + return this.piston.get(); + } +} From 4ec6a82fb9dee05213f8222df92cc6ad39b9a91f Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 20:38:26 -0400 Subject: [PATCH 079/121] Change to !!FUN!! new gear grasping scheme --- .../team3494/robot/subsystems/GearTake_2.java | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java index 87a3586..70f4687 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java @@ -24,15 +24,17 @@ public class GearTake_2 extends Subsystem { /** * The solenoid that holds the gear or drops it. */ - private DoubleSolenoid openandclose; + private DoubleSolenoid openandclose_forward; + private DoubleSolenoid openandclose_backward; public LineBreak lb; public GearTake_2() { super(); this.rampenoid = new DoubleSolenoid(RobotMap.GEAR_RAMP_CHONE, RobotMap.GEAR_RAMP_CHTWO); - this.openandclose = new DoubleSolenoid(RobotMap.GEAR_GRASP_CHONE, RobotMap.GEAR_GRASP_CHTWO); - this.openandclose.set(Value.kReverse); + this.openandclose_forward = new DoubleSolenoid(RobotMap.GEAR_GRASP_CHONE, RobotMap.GEAR_GRASP_CHTWO); + this.openandclose_backward = new DoubleSolenoid(RobotMap.INTAKE_PISTON_CHONE, RobotMap.INTAKE_PISTON_CHTWO); + this.openandclose_forward.set(Value.kReverse); this.lb = new LineBreak(0); } @@ -59,7 +61,16 @@ public void setRamp(Value value) { * The position to set the holder to. */ public void setGrasp(Value value) { - this.openandclose.set(value); + if (value.equals(Value.kForward)) { + this.openandclose_forward.set(Value.kForward); + this.openandclose_backward.set(Value.kReverse); + } else if (value.equals(Value.kReverse)) { + this.openandclose_backward.set(Value.kForward); + this.openandclose_forward.set(Value.kReverse); + } else { + this.openandclose_backward.set(Value.kReverse); + this.openandclose_backward.set(Value.kReverse); + } } /** @@ -78,7 +89,8 @@ public void closeHolder() { /** * Gets the state of the intake ramp solenoid. Equivalent to - * {@code this.rampenoid.get()}, but {@link GearTake_2#rampenoid} is private. + * {@code this.rampenoid.get()}, but {@link GearTake_2#rampenoid} is + * private. * * @return The value of {@code this.rampenoid.get()}. */ @@ -88,12 +100,12 @@ public Value getRampState() { /** * Gets the state of the gear holder. Equivalent to - * {@code this.openandclose.get()}, but {@link GearTake_2#openandclose} is - * private. + * {@code this.openandclose.get()}, but + * {@link GearTake_2#openandclose_forward} is private. * * @return The value of {@code this.openandclose.get()}. */ public Value getGearState() { - return this.openandclose.get(); + return this.openandclose_forward.get(); } } From 37fc0f187a649fdeb632290e9bfe31c735cd5141 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Thu, 23 Mar 2017 21:21:05 -0400 Subject: [PATCH 080/121] Remove intake susbsytem it no longer exists --- .../org/usfirst/frc/team3494/robot/OI.java | 3 - .../org/usfirst/frc/team3494/robot/Robot.java | 3 - .../robot/commands/intake/RunIntake.java | 54 ------------ .../robot/commands/intake/SwitchPosition.java | 53 ------------ .../robot/commands/intake/package-info.java | 7 -- .../frc/team3494/robot/subsystems/Intake.java | 82 ------------------- 6 files changed, 202 deletions(-) delete mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/RunIntake.java delete mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/SwitchPosition.java delete mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/package-info.java delete mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Intake.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index 5f977dd..b998e44 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -7,7 +7,6 @@ import org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain; import org.usfirst.frc.team3494.robot.commands.gears.HoldInState; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; -import org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition; import org.usfirst.frc.team3494.robot.commands.turret.Shoot; import edu.wpi.first.wpilibj.Joystick; @@ -76,8 +75,6 @@ public OI() { // Climb controls xbox_a_2.whileActive(new Climb(DriveDirections.UP)); xbox_a_2.whenReleased(new StopClimber()); - // Intake motion - xbox_b_2.whenPressed(new SwitchPosition()); xbox_x_2.whileHeld(new HoldInState()); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 1b8ec53..06c1ff0 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -15,7 +15,6 @@ import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; import org.usfirst.frc.team3494.robot.subsystems.GearTake_2; -import org.usfirst.frc.team3494.robot.subsystems.Intake; import org.usfirst.frc.team3494.robot.subsystems.Kompressor; import org.usfirst.frc.team3494.robot.subsystems.Turret; import org.usfirst.frc.team3494.robot.vision.GripPipeline; @@ -50,7 +49,6 @@ public class Robot extends IterativeRobot { public static Drivetrain driveTrain; public static Climber climber; public static Turret turret; - public static Intake intake; public static Kompressor kompressor; public static GearTake_2 gearTake; /** @@ -94,7 +92,6 @@ public void robotInit() { climber.disengagePTO(); turret = new Turret(); kompressor = new Kompressor(); - intake = new Intake(); gearTake = new GearTake_2(); oi = new OI(); ahrs = new AHRS(SerialPort.Port.kMXP); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/RunIntake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/RunIntake.java deleted file mode 100644 index feff20b..0000000 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/RunIntake.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.usfirst.frc.team3494.robot.commands.intake; - -import org.usfirst.frc.team3494.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * Runs the intake. Default command for Intake subsystem. - */ -public class RunIntake extends Command { - - boolean running = false; - double speed; - - public RunIntake() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.intake); - } - - // Called just before this Command runs the first time - @Override - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - @Override - protected void execute() { - if (Robot.oi.xbox_rt.get()) { - Robot.intake.runIntake(0.75); - } else if (Robot.oi.xbox_lt.get()) { - Robot.intake.runIntake(-0.75); - } else { - Robot.intake.stopAll(); - } - } - - // Make this return true when this Command no longer needs to run execute() - @Override - protected boolean isFinished() { - return false; - } - - // Called once after isFinished returns true - @Override - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - @Override - protected void interrupted() { - } -} diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/SwitchPosition.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/SwitchPosition.java deleted file mode 100644 index 2b5c6ef..0000000 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/SwitchPosition.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.usfirst.frc.team3494.robot.commands.intake; - -import org.usfirst.frc.team3494.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; - -/** - * Deploys the intake for the start of teleop. - * - * @see org.usfirst.frc.team3494.robot.subsystems.Intake - */ -public class SwitchPosition extends Command { - - public SwitchPosition() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.intake); - } - - // Called just before this Command runs the first time - @Override - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - @Override - protected void execute() { - if (!Robot.intake.isDeployed) { - Robot.intake.pushForward(); - } else { - Robot.intake.retract(); - } - SmartDashboard.putBoolean("Intake Deployed", Robot.intake.isDeployed); - } - - // Make this return true when this Command no longer needs to run execute() - @Override - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - @Override - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - @Override - protected void interrupted() { - } -} diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/package-info.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/package-info.java deleted file mode 100644 index e9ecfbd..0000000 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/intake/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Package for intake-related commands. Commands for use in auto belong in - * {@link org.usfirst.frc.team3494.robot.commands.auto}. - * - * @see org.usfirst.frc.team3494.robot.subsystems.Intake - */ -package org.usfirst.frc.team3494.robot.commands.intake; \ No newline at end of file diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Intake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Intake.java deleted file mode 100644 index f372443..0000000 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Intake.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.usfirst.frc.team3494.robot.subsystems; - -import org.usfirst.frc.team3494.robot.RobotMap; -import org.usfirst.frc.team3494.robot.commands.intake.RunIntake; - -import edu.wpi.first.wpilibj.DoubleSolenoid; -import edu.wpi.first.wpilibj.Talon; -import edu.wpi.first.wpilibj.command.Subsystem; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; - -/** - * Intake subsystem. Contains methods for controlling the ball intake. - * - * @since 0.0.0 - */ -public class Intake extends Subsystem implements IMotorizedSubsystem { - /** - * Talon that controls the intake. Thankfully there's only one. - * - * @see RobotMap - */ - private Talon inMotor; - private Talon upMotor; - // pistons push - private DoubleSolenoid piston; - public boolean isDeployed; - - public Intake() { - super("Intake"); - this.inMotor = new Talon(RobotMap.INTAKE_MOTOR); - this.upMotor = new Talon(RobotMap.UP_MOTOR); - this.upMotor.setInverted(true); - this.piston = new DoubleSolenoid(RobotMap.INTAKE_PISTON_CHONE, RobotMap.INTAKE_PISTON_CHTWO); - this.isDeployed = false; - } - // Put methods for controlling this subsystem - // here. Call these from Commands. - - @Override - public void initDefaultCommand() { - // Set the default command for a subsystem here. - // setDefaultCommand(new MySpecialCommand()); - this.setDefaultCommand(new RunIntake()); - } - - public void runIntake(double speed) { - this.inMotor.set(speed); - this.upMotor.set(speed); - } - - @Override - public void stopAll() { - this.inMotor.set(0); - this.upMotor.set(0); - } - - @Override - public void setAll(double speed) { - this.inMotor.set(speed); - this.upMotor.set(speed); - } - - public void pushForward() { - this.piston.set(DoubleSolenoid.Value.kForward); - this.isDeployed = true; - } - - public void retract() { - this.piston.set(DoubleSolenoid.Value.kReverse); - this.isDeployed = false; - } - - public void setPiston(DoubleSolenoid.Value position) { - this.piston.set(position); - if (position.equals(DoubleSolenoid.Value.kForward)) { - this.isDeployed = true; - } else { - this.isDeployed = true; - } - SmartDashboard.putBoolean("Intake Deployed", this.isDeployed); - } -} From 199bd3a926b57d9069d26fb088a32c26a308c31b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 08:15:54 -0400 Subject: [PATCH 081/121] Create controls for triple position holder --- .../org/usfirst/frc/team3494/robot/OI.java | 7 +++- .../usfirst/frc/team3494/robot/RobotMap.java | 7 ++-- ...dInState.java => HoldInState_Forward.java} | 6 +-- .../robot/commands/gears/SetReverse.java | 41 +++++++++++++++++++ .../team3494/robot/subsystems/GearTake_2.java | 16 ++++++-- 5 files changed, 65 insertions(+), 12 deletions(-) rename 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/{HoldInState.java => HoldInState_Forward.java} (89%) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index b998e44..629fb2f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -5,7 +5,8 @@ import org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle; import org.usfirst.frc.team3494.robot.commands.climb.StopClimber; import org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain; -import org.usfirst.frc.team3494.robot.commands.gears.HoldInState; +import org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward; +import org.usfirst.frc.team3494.robot.commands.gears.SetReverse; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; import org.usfirst.frc.team3494.robot.commands.turret.Shoot; @@ -76,7 +77,9 @@ public OI() { xbox_a_2.whileActive(new Climb(DriveDirections.UP)); xbox_a_2.whenReleased(new StopClimber()); - xbox_x_2.whileHeld(new HoldInState()); + xbox_b_2.whenPressed(new SetReverse()); + + xbox_x_2.whileHeld(new HoldInState_Forward()); xbox_y_2.whenPressed(new ToggleGearRamp()); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java index 6c58c5c..2c03a39 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java @@ -50,14 +50,15 @@ public class RobotMap { public static final int TURRET_UPPER = 64; public static final int COMPRESSOR = 0; - // intake pistons - public static final int INTAKE_PISTON_CHONE = 0; - public static final int INTAKE_PISTON_CHTWO = 1; // gear holder pistons public static final int GEAR_RAMP_CHONE = 2; public static final int GEAR_RAMP_CHTWO = 3; public static final int GEAR_GRASP_CHONE = 4; public static final int GEAR_GRASP_CHTWO = 5; + + public static final int GEAR_GRASP_S2_FORWARD = 1; + public static final int GEAR_GRASP_S2_BACKWARD = 0; + // conveyer public static final int CONVEYER_M = 14; // single piston gear holder diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState_Forward.java similarity index 89% rename from 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java rename to 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState_Forward.java index 223143a..700c1e2 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/HoldInState_Forward.java @@ -8,9 +8,9 @@ /** * Holds the gear holder in the given position until canceled. */ -public class HoldInState extends Command { +public class HoldInState_Forward extends Command { - public HoldInState() { + public HoldInState_Forward() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); requires(Robot.gearTake); @@ -36,7 +36,7 @@ protected boolean isFinished() { // Called once after isFinished returns true @Override protected void end() { - Robot.gearTake.setGrasp(Value.kReverse); + Robot.gearTake.setGrasp(Value.kOff); } // Called when another command which requires one or more of the same diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java new file mode 100644 index 0000000..0bbb681 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java @@ -0,0 +1,41 @@ +package org.usfirst.frc.team3494.robot.commands.gears; + +import org.usfirst.frc.team3494.robot.Robot; + +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; +import edu.wpi.first.wpilibj.command.Command; + +/** + * + */ +public class SetReverse extends Command { + + public SetReverse() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.gearTake); + } + + // Called just before this Command runs the first time + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + Robot.gearTake.setGrasp(Value.kReverse); + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return true; + } + + // Called once after isFinished returns true + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } +} diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java index 70f4687..fbf83e7 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.java @@ -33,8 +33,14 @@ public GearTake_2() { super(); this.rampenoid = new DoubleSolenoid(RobotMap.GEAR_RAMP_CHONE, RobotMap.GEAR_RAMP_CHTWO); this.openandclose_forward = new DoubleSolenoid(RobotMap.GEAR_GRASP_CHONE, RobotMap.GEAR_GRASP_CHTWO); - this.openandclose_backward = new DoubleSolenoid(RobotMap.INTAKE_PISTON_CHONE, RobotMap.INTAKE_PISTON_CHTWO); + this.openandclose_backward = new DoubleSolenoid(RobotMap.GEAR_GRASP_S2_FORWARD, + RobotMap.GEAR_GRASP_S2_BACKWARD); + this.openandclose_forward.set(Value.kForward); this.openandclose_forward.set(Value.kReverse); + + this.openandclose_backward.set(Value.kReverse); + this.openandclose_backward.set(Value.kForward); + this.lb = new LineBreak(0); } @@ -63,13 +69,15 @@ public void setRamp(Value value) { public void setGrasp(Value value) { if (value.equals(Value.kForward)) { this.openandclose_forward.set(Value.kForward); - this.openandclose_backward.set(Value.kReverse); - } else if (value.equals(Value.kReverse)) { this.openandclose_backward.set(Value.kForward); + } else if (value.equals(Value.kReverse)) { + this.openandclose_backward.set(Value.kReverse); this.openandclose_forward.set(Value.kReverse); } else { + this.openandclose_forward.set(Value.kForward); + this.openandclose_forward.set(Value.kReverse); this.openandclose_backward.set(Value.kReverse); - this.openandclose_backward.set(Value.kReverse); + this.openandclose_backward.set(Value.kForward); } } From 2c0b907749f1ed93369c4ef331559eae326441eb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 09:00:39 -0400 Subject: [PATCH 082/121] Comment old encoders --- .../team3494/robot/subsystems/Drivetrain.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 483ecb1..7fcd588 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -129,14 +129,17 @@ public Drivetrain() { this.wpiDrive.setExpiration(Integer.MAX_VALUE); this.wpiDrive.setSafetyEnabled(false); - this.encRight = new Encoder(RobotMap.ENCODER_RIGHT_A, RobotMap.ENCODER_RIGHT_B); - this.encRight.setDistancePerPulse(1 / 360); - this.encRight.reset(); - - this.encLeft = new Encoder(RobotMap.ENCODER_LEFT_A, RobotMap.ENCODER_LEFT_B); - this.encLeft.setDistancePerPulse(1 / 360); - this.encLeft.setReverseDirection(true); - this.encLeft.reset(); + /* + * this.encRight = new Encoder(RobotMap.ENCODER_RIGHT_A, + * RobotMap.ENCODER_RIGHT_B); this.encRight.setDistancePerPulse(1 / + * 360); this.encRight.reset(); + */ + + /* + * this.encLeft = new Encoder(RobotMap.ENCODER_LEFT_A, + * RobotMap.ENCODER_LEFT_B); this.encLeft.setDistancePerPulse(1 / 360); + * this.encLeft.setReverseDirection(true); this.encLeft.reset(); + */ // PID control this.PIDTune = 0; double outRange = 0.5; From 8649eb5d39fb0ae32ceeb55f716b408f3b283996 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 09:05:22 -0400 Subject: [PATCH 083/121] Format source --- .../org/usfirst/frc/team3494/robot/OI.java | 2 +- .../usfirst/frc/team3494/robot/RobotMap.java | 4 +- .../robot/commands/gears/SetReverse.java | 56 +++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java index 629fb2f..7ab7abc 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/OI.java @@ -78,7 +78,7 @@ public OI() { xbox_a_2.whenReleased(new StopClimber()); xbox_b_2.whenPressed(new SetReverse()); - + xbox_x_2.whileHeld(new HoldInState_Forward()); xbox_y_2.whenPressed(new ToggleGearRamp()); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java index 2c03a39..dd892d0 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java @@ -55,10 +55,10 @@ public class RobotMap { public static final int GEAR_RAMP_CHTWO = 3; public static final int GEAR_GRASP_CHONE = 4; public static final int GEAR_GRASP_CHTWO = 5; - + public static final int GEAR_GRASP_S2_FORWARD = 1; public static final int GEAR_GRASP_S2_BACKWARD = 0; - + // conveyer public static final int CONVEYER_M = 14; // single piston gear holder diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java index 0bbb681..6e829e9 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java @@ -10,32 +10,32 @@ */ public class SetReverse extends Command { - public SetReverse() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.gearTake); - } - - // Called just before this Command runs the first time - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - Robot.gearTake.setGrasp(Value.kReverse); - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } + public SetReverse() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + requires(Robot.gearTake); + } + + // Called just before this Command runs the first time + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + Robot.gearTake.setGrasp(Value.kReverse); + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return true; + } + + // Called once after isFinished returns true + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } } From bb960c35d2cc311e9ff0a7fd2fcb87821c29caee Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:20:19 -0400 Subject: [PATCH 084/121] Revise DistanceDrive for abs values --- .../team3494/robot/commands/auto/DistanceDrive.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index 8e76ec9..d596cf9 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -45,9 +45,9 @@ protected void initialize() { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - if (this.dist > Robot.driveTrain.getAvgDistance(this.unit)) { + if (this.dist > 0) { Robot.driveTrain.adjustedTankDrive(0.185, 0.2); - } else if (this.dist < Robot.driveTrain.getAvgDistance(this.unit)) { + } else if (this.dist < 0) { Robot.driveTrain.adjustedTankDrive(-0.185, -0.2); } else { return; @@ -58,13 +58,7 @@ protected void execute() { // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { - boolean isDone; - if (this.dist < 0) { - isDone = Robot.driveTrain.getAvgDistance(this.unit) <= this.dist; - } else { - isDone = Robot.driveTrain.getAvgDistance(this.unit) >= this.dist; - } - return isDone; + return Math.abs(Robot.driveTrain.getAvgDistance(unit)) >= Math.abs(this.dist); } // Called once after isFinished returns true From e7953ba338b169f6f46c36e0948f8eee82e278ce Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:20:36 -0400 Subject: [PATCH 085/121] Correct error, don't amplify --- .../frc/team3494/robot/commands/auto/PIDAngleDrive.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java index 672b235..b588bfc 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.java @@ -38,8 +38,7 @@ protected void initialize() { protected void execute() { SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); System.out.println(Robot.ahrs.getAngle()); - // System.out.println(Robot.driveTrain.PIDTune); - Robot.driveTrain.ArcadeDrive(0, Robot.driveTrain.PIDTune, true); + Robot.driveTrain.ArcadeDrive(0, -Robot.driveTrain.PIDTune, true); } // Make this return true when this Command no longer needs to run execute() From a0bbe76ffd4d9443fc7d03199d3ebb6a5a7065f1 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:20:55 -0400 Subject: [PATCH 086/121] Add missing overrides --- .../frc/team3494/robot/commands/auto/tests/SpeedTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java index efcf5c0..f59cafc 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.java @@ -19,6 +19,7 @@ public SpeedTest() { } // Called just before this Command runs the first time + @Override protected void initialize() { Robot.driveTrain.leftSide[0].changeControlMode(TalonControlMode.Speed); Robot.driveTrain.leftSide[0].setProfile(0); @@ -36,6 +37,7 @@ protected void initialize() { } // Called repeatedly when this Command is scheduled to run + @Override protected void execute() { SmartDashboard.putNumber("left: ", Robot.driveTrain.leftSide[0].getSpeed()); SmartDashboard.putNumber("right:", Robot.driveTrain.rightSide[0].getSpeed()); @@ -48,11 +50,13 @@ protected void execute() { } // Make this return true when this Command no longer needs to run execute() + @Override protected boolean isFinished() { return false; } // Called once after isFinished returns true + @Override protected void end() { for (CANTalon t : Robot.driveTrain.leftSide) { t.changeControlMode(TalonControlMode.PercentVbus); @@ -64,6 +68,7 @@ protected void end() { // Called when another command which requires one or more of the same // subsystems is scheduled to run + @Override protected void interrupted() { end(); } From 0c68b8e6b8afc580b9e517c99e08358c0613f4d1 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:21:09 -0400 Subject: [PATCH 087/121] Implement full flight stick control --- .../frc/team3494/robot/commands/drive/Drive.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 7c3f583..8e0ffd6 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -32,14 +32,14 @@ protected void initialize() { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - int dpad = Robot.oi.xbox.getPOV(); - if (dpad == 0) { + int dpad = Robot.oi.stick_l.getPOV(); + if (dpad == 0 || Robot.oi.stick_l.getRawButton(7)) { Robot.driveTrain.inverter = 1; - } else if (dpad == 180) { + } else if (dpad == 180 || Robot.oi.stick_l.getRawButton(8)) { Robot.driveTrain.inverter = -1; - } else if (dpad == 270) { + } else if (dpad == 270 || Robot.oi.stick_l.getRawButton(9)) { Robot.driveTrain.scaleDown = 0.5D; - } else if (dpad == 90) { + } else if (dpad == 90 || Robot.oi.stick_l.getRawButton(10)) { Robot.driveTrain.scaleDown = 1.0D; } SmartDashboard.putNumber("inverter", Robot.driveTrain.inverter); @@ -50,12 +50,12 @@ protected void execute() { if (Robot.driveTrain.getInverted()) { Robot.driveTrain.ArcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); } else { Robot.driveTrain.ArcadeDrive( Robot.oi.xbox.getY(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, - -Robot.oi.xbox.getX(Hand.kRight) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, + -Robot.oi.xbox.getX(Hand.kLeft) * Robot.driveTrain.inverter * Robot.driveTrain.scaleDown, true); } } else { From 23ec5f282e969a68a1d2b2bed725e3f843916bd1 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:21:20 -0400 Subject: [PATCH 088/121] Add more missing overrides --- .../frc/team3494/robot/commands/gears/SetReverse.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java index 6e829e9..a59a4f8 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.java @@ -17,25 +17,30 @@ public SetReverse() { } // Called just before this Command runs the first time + @Override protected void initialize() { } // Called repeatedly when this Command is scheduled to run + @Override protected void execute() { Robot.gearTake.setGrasp(Value.kReverse); } // Make this return true when this Command no longer needs to run execute() + @Override protected boolean isFinished() { return true; } // Called once after isFinished returns true + @Override protected void end() { } // Called when another command which requires one or more of the same // subsystems is scheduled to run + @Override protected void interrupted() { } } From 2e1ee76744918121cd754b1fc64ce53c5a703ae4 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:21:32 -0400 Subject: [PATCH 089/121] Add one more missing override --- .../org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java | 1 + 1 file changed, 1 insertion(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java index ebe9c39..53e8805 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.java @@ -15,6 +15,7 @@ public class MonoGearTake extends Subsystem { // here. Call these from Commands. private DoubleSolenoid piston; + @Override public void initDefaultCommand() { // Set the default command for a subsystem here. // setDefaultCommand(new MySpecialCommand()); From 03a2a7e9ee982ee60c7e97cce9b5ad118404af6b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:21:52 -0400 Subject: [PATCH 090/121] Remove old encoders --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 7fcd588..4457733 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -9,7 +9,6 @@ import com.ctre.CANTalon.FeedbackDevice; import com.ctre.CANTalon.TalonControlMode; -import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.RobotDrive; import edu.wpi.first.wpilibj.command.PIDSubsystem; @@ -66,8 +65,6 @@ public class Drivetrain extends PIDSubsystem implements IMotorizedSubsystem { * @since 0.0.0 */ public RobotDrive wpiDrive; - private Encoder encRight; - private Encoder encLeft; public static final double RAMP = 48; From 71918b8a89d643e1e697df59157a9424c9520083 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:22:06 -0400 Subject: [PATCH 091/121] Refine P constant --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 4457733..55fbfeb 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -77,7 +77,7 @@ public class Drivetrain extends PIDSubsystem implements IMotorizedSubsystem { public double PIDTune; public Drivetrain() { - super("Drivetrain", 0.0035, 0, 0); + super("Drivetrain", 0.035, 0, 0); // int maxAmps = 50; // create left talons this.driveLeftMaster = new CANTalon(RobotMap.leftTalonOne); From cf0d0033211fe4fea17f4adb40841ff84e6dffda Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:22:47 -0400 Subject: [PATCH 092/121] Correct encoder methods for talon encoders --- .../frc/team3494/robot/subsystems/Drivetrain.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 55fbfeb..c39555f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -257,7 +257,7 @@ public void ArcadeDrive(double moveValue, double rotateValue, boolean squaredInp */ public double getRightDistance(UnitTypes unit) { double encCountsTalon = this.driveRightMaster.getPosition(); - double inches = (Math.PI * 4) * (encCountsTalon / 360); + double inches = (Math.PI * 4) * (encCountsTalon); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -267,7 +267,7 @@ public double getRightDistance(UnitTypes unit) { } else if (unit.equals(UnitTypes.CENTIMETERS)) { return inches * 2.540; } else { - return this.encRight.get(); + return this.driveRightMaster.getPosition(); } } @@ -280,7 +280,7 @@ public double getRightDistance(UnitTypes unit) { */ public double getLeftDistance(UnitTypes unit) { double talonEncDist = this.driveLeftMaster.getPosition(); - double inches = (Math.PI * 4) * (talonEncDist / 360); + double inches = (Math.PI * 4) * (talonEncDist); if (unit.equals(UnitTypes.INCHES)) { return inches; } else if (unit.equals(UnitTypes.FEET)) { @@ -290,7 +290,7 @@ public double getLeftDistance(UnitTypes unit) { } else if (unit.equals(UnitTypes.CENTIMETERS)) { return inches * 2.540; } else { - return this.encLeft.get(); + return this.driveLeftMaster.getPosition(); } } @@ -302,7 +302,7 @@ public double getAvgDistance(UnitTypes unit) { * Resets the encoder on the right side of the drivetrain. */ public void resetRight() { - this.encRight.reset(); + // this.encRight.reset(); this.driveRightMaster.setPosition(0); } @@ -310,7 +310,7 @@ public void resetRight() { * Resets the encoder on the left side of the drivetrain. */ public void resetLeft() { - this.encLeft.reset(); + // this.encLeft.reset(); this.driveLeftMaster.setPosition(0); } @@ -387,7 +387,7 @@ public void snapBackToReality() { @Override protected double returnPIDInput() { - return Robot.ahrs.getAngle(); + return Robot.ahrs.getYaw(); } @Override From e2b0beb749b932b7e7f65bc4984548dadf422038 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:22:54 -0400 Subject: [PATCH 093/121] Refine PID --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index c39555f..e8356e3 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -142,7 +142,7 @@ public Drivetrain() { double outRange = 0.5; this.getPIDController().setInputRange(-180, 180); this.getPIDController().setOutputRange(-outRange, outRange); - this.getPIDController().setContinuous(true); + this.getPIDController().setContinuous(false); this.getPIDController().setPercentTolerance(20); } // Put methods for controlling this subsystem From fccee86fc3ce5973933c4dac962777da77f04d17 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:23:13 -0400 Subject: [PATCH 094/121] Correct PID error don't propagate it --- .../frc/team3494/robot/commands/auto/PIDFullDrive.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index e510af5..9ca3114 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -52,14 +52,15 @@ protected void initialize() { @Override protected void execute() { SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); - System.out.println(Robot.ahrs.getAngle()); + System.out.println(Robot.ahrs.getYaw()); // System.out.println(Robot.driveTrain.PIDTune); - Robot.driveTrain.ArcadeDrive(0.4, Robot.driveTrain.PIDTune, true); + Robot.driveTrain.ArcadeDrive(0.4, -Robot.driveTrain.PIDTune, true); } // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { + // return false; return Math.abs(Robot.driveTrain.getAvgDistance(UnitTypes.INCHES)) >= Math.abs(this.distance); } From 7ad4aeaf50ea80b5f1dd2270247f42e598e50a07 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:23:29 -0400 Subject: [PATCH 095/121] Disengage PTO on start --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 06c1ff0..150d4fd 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -95,9 +95,11 @@ public void robotInit() { gearTake = new GearTake_2(); oi = new OI(); ahrs = new AHRS(SerialPort.Port.kMXP); + Robot.climber.disengagePTO(); // Auto programs come after all subsystems are created chooser.addDefault("To the baseline!", new ConstructedAuto(AutoGenerator.crossBaseLine())); chooser.addObject("Center Gear Placer", new ConstructedAuto(AutoGenerator.placeCenterGear())); + chooser.addObject("Side Gear Attempt", new ConstructedAuto(AutoGenerator.gearPlaceAttempt())); chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); chooser.addObject("Do nothing", new NullAuto()); From 75be481f86b7ae244e5d59fd87ce235251538deb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:23:50 -0400 Subject: [PATCH 096/121] Add side gear placer yes please maybe yes --- .../frc/team3494/robot/AutoGenerator.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index d16fa50..68e1537 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -3,8 +3,9 @@ import java.util.ArrayList; import org.usfirst.frc.team3494.robot.commands.DelayCommand; -import org.usfirst.frc.team3494.robot.commands.auto.AngleTurn; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; +import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; +import org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; @@ -44,7 +45,7 @@ public static ArrayList autoOne() { */ public static ArrayList crossBaseLine() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(-112 / 2, UnitTypes.INCHES)); + list.add(new DistanceDrive(-72, UnitTypes.INCHES)); return list; } @@ -60,14 +61,9 @@ public static ArrayList placeCenterGear() { public static ArrayList gearPlaceAttempt() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(93.25, UnitTypes.INCHES)); - list.add(new AngleTurn(-180)); - double rise = 20.462; - double run = 32.463; - list.add(new AngleTurn(Math.toDegrees(Math.atan2(20.462, 32.463)))); - double dist = 10; - dist = Math.sqrt((rise * rise) + (run * run)); - list.add(new DistanceDrive(-dist, UnitTypes.INCHES)); + list.add(new PIDFullDrive(-80)); + list.add(new PIDAngleDrive(60)); + list.add(new PIDFullDrive(-60)); return list; } } From 8c6720389961a3984fd6966c209c33983e78739a Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:58:38 -0400 Subject: [PATCH 097/121] Drastically lower angle tolerance --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index e8356e3..5d69131 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -143,7 +143,7 @@ public Drivetrain() { this.getPIDController().setInputRange(-180, 180); this.getPIDController().setOutputRange(-outRange, outRange); this.getPIDController().setContinuous(false); - this.getPIDController().setPercentTolerance(20); + this.getPIDController().setPercentTolerance(1); } // Put methods for controlling this subsystem // here. Call these from Commands. From 9a8ccd8f8437fdf096b88a664c6d57eb77409a49 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:58:56 -0400 Subject: [PATCH 098/121] Add left gear place attempt --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 68e1537..5adaf4b 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -66,4 +66,12 @@ public static ArrayList gearPlaceAttempt() { list.add(new PIDFullDrive(-60)); return list; } + + public static ArrayList gearPlaceAttemptLeft() { + ArrayList list = new ArrayList(); + list.add(new PIDFullDrive(-80)); + list.add(new PIDAngleDrive(-60)); + list.add(new PIDFullDrive(-60)); + return list; + } } From ffe169cb91bfd13e937a615bcf5815c7b643a524 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 14:59:17 -0400 Subject: [PATCH 099/121] Add both gear place attempts --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 150d4fd..a543989 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -99,7 +99,8 @@ public void robotInit() { // Auto programs come after all subsystems are created chooser.addDefault("To the baseline!", new ConstructedAuto(AutoGenerator.crossBaseLine())); chooser.addObject("Center Gear Placer", new ConstructedAuto(AutoGenerator.placeCenterGear())); - chooser.addObject("Side Gear Attempt", new ConstructedAuto(AutoGenerator.gearPlaceAttempt())); + chooser.addObject("[beta] Right Gear Attempt", new ConstructedAuto(AutoGenerator.gearPlaceAttempt())); + chooser.addObject("[beta] Left Gear Attempt", new ConstructedAuto(AutoGenerator.gearPlaceAttemptLeft())); chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); chooser.addObject("Do nothing", new NullAuto()); @@ -205,6 +206,7 @@ public void autonomousInit() { */ @Override public void autonomousPeriodic() { + SmartDashboard.putData(Scheduler.getInstance()); if (autonomousCommand != null) { Scheduler.getInstance().run(); } else { From 8c0aaaf43841f14b6856c90b48bf903707020b7d Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 15:49:34 -0400 Subject: [PATCH 100/121] Remove old auto programs --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index a543989..3941dd3 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -10,8 +10,6 @@ import org.usfirst.frc.team3494.robot.commands.auto.NullAuto; import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; import org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive; -import org.usfirst.frc.team3494.robot.commands.auto.StageTest; -import org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest; import org.usfirst.frc.team3494.robot.subsystems.Climber; import org.usfirst.frc.team3494.robot.subsystems.Drivetrain; import org.usfirst.frc.team3494.robot.subsystems.GearTake_2; @@ -101,12 +99,10 @@ public void robotInit() { chooser.addObject("Center Gear Placer", new ConstructedAuto(AutoGenerator.placeCenterGear())); chooser.addObject("[beta] Right Gear Attempt", new ConstructedAuto(AutoGenerator.gearPlaceAttempt())); chooser.addObject("[beta] Left Gear Attempt", new ConstructedAuto(AutoGenerator.gearPlaceAttemptLeft())); - chooser.addObject("Staging test", new StageTest()); chooser.addObject("Follow the shiny", null); chooser.addObject("Do nothing", new NullAuto()); chooser.addObject("PID Test - turn 90 degrees", new PIDAngleDrive(90)); chooser.addObject("PID Test - drive straight", new PIDFullDrive(36)); - chooser.addDefault("Speed test", new SpeedTest()); // put chooser on DS SmartDashboard.putData("AUTO CHOOSER", chooser); // get preferences From d34cf7aad4cb2d38633ae2df9467ec421f0fb157 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:19:20 -0400 Subject: [PATCH 101/121] Move stage test --- .../frc/team3494/robot/commands/auto/{ => tests}/StageTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/{ => tests}/StageTest.java (94%) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/StageTest.java similarity index 94% rename from 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java rename to 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/StageTest.java index 04901c3..2958819 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/StageTest.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/tests/StageTest.java @@ -1,4 +1,4 @@ -package org.usfirst.frc.team3494.robot.commands.auto; +package org.usfirst.frc.team3494.robot.commands.auto.tests; import org.usfirst.frc.team3494.robot.Robot; From 3df3877ba2922ef0cf9e378ebac1b4a19ac1adfb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:21:20 -0400 Subject: [PATCH 102/121] Correct encoder resetting --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 5d69131..0e8aacb 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -303,7 +303,7 @@ public double getAvgDistance(UnitTypes unit) { */ public void resetRight() { // this.encRight.reset(); - this.driveRightMaster.setPosition(0); + this.driveRightMaster.setEncPosition(0); } /** @@ -311,7 +311,7 @@ public void resetRight() { */ public void resetLeft() { // this.encLeft.reset(); - this.driveLeftMaster.setPosition(0); + this.driveLeftMaster.setEncPosition(0); } @Override From 1874de1f0311457ec1825bd676c05bfa13ed70d5 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:21:30 -0400 Subject: [PATCH 103/121] Adjust PID tolerance --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 0e8aacb..d43d06c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -143,7 +143,7 @@ public Drivetrain() { this.getPIDController().setInputRange(-180, 180); this.getPIDController().setOutputRange(-outRange, outRange); this.getPIDController().setContinuous(false); - this.getPIDController().setPercentTolerance(1); + this.getPIDController().setPercentTolerance(2.5); } // Put methods for controlling this subsystem // here. Call these from Commands. From 363b1e986a23d13c0dff23538f3fe4f7945748eb Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:21:55 -0400 Subject: [PATCH 104/121] Stray further from Dean Kamen's light --- .../team3494/robot/commands/auto/PIDFullDrive.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index 9ca3114..2da421c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -43,6 +43,14 @@ public PIDFullDrive(double dist) { // Called just before this Command runs the first time @Override protected void initialize() { + Robot.driveTrain.resetLeft(); + Robot.driveTrain.resetRight(); + try { + Thread.sleep((long) 5); + } catch (InterruptedException e) { + System.out.println("ah crap"); + e.printStackTrace(); + } Robot.ahrs.reset(); Robot.driveTrain.enable(); Robot.driveTrain.setSetpoint(this.angle); @@ -54,7 +62,7 @@ protected void execute() { SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); System.out.println(Robot.ahrs.getYaw()); // System.out.println(Robot.driveTrain.PIDTune); - Robot.driveTrain.ArcadeDrive(0.4, -Robot.driveTrain.PIDTune, true); + Robot.driveTrain.ArcadeDrive(0.5, -Robot.driveTrain.PIDTune, true); } // Make this return true when this Command no longer needs to run execute() @@ -67,6 +75,7 @@ protected boolean isFinished() { // Called once after isFinished returns true @Override protected void end() { + System.out.println("done PID driving"); Robot.driveTrain.disable(); Robot.driveTrain.stopAll(); } From 4ae10cf12d477c95ec519b96ee28912e1607bd1b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:22:18 -0400 Subject: [PATCH 105/121] changes --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 6 ++++-- .../frc/team3494/robot/commands/auto/DistanceDrive.java | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 5adaf4b..5f1fc47 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -62,8 +62,9 @@ public static ArrayList placeCenterGear() { public static ArrayList gearPlaceAttempt() { ArrayList list = new ArrayList(); list.add(new PIDFullDrive(-80)); - list.add(new PIDAngleDrive(60)); + list.add(new PIDAngleDrive(65)); list.add(new PIDFullDrive(-60)); + // list.add(new DistanceDrive(-60, UnitTypes.INCHES)); return list; } @@ -71,7 +72,8 @@ public static ArrayList gearPlaceAttemptLeft() { ArrayList list = new ArrayList(); list.add(new PIDFullDrive(-80)); list.add(new PIDAngleDrive(-60)); - list.add(new PIDFullDrive(-60)); + // list.add(new PIDFullDrive(-60)); + list.add(new DistanceDrive(-60, UnitTypes.INCHES)); return list; } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index d596cf9..0f43fd6 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -39,6 +39,12 @@ public DistanceDrive(double distance, UnitTypes unitType) { protected void initialize() { Robot.driveTrain.resetRight(); Robot.driveTrain.resetLeft(); + try { + Thread.sleep((long) 5); + } catch (InterruptedException e) { + System.out.println("ah crap"); + e.printStackTrace(); + } System.out.println("Driving " + this.dist + " " + this.unit.toString() + "(s)"); } From 595253667d61350602e4b47dc0a9c42f0514d0b9 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:28:28 -0400 Subject: [PATCH 106/121] Add gear holder actuation to auto --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 5f1fc47..f93b457 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -6,10 +6,12 @@ import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; import org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive; +import org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.command.Command; /** @@ -65,6 +67,7 @@ public static ArrayList gearPlaceAttempt() { list.add(new PIDAngleDrive(65)); list.add(new PIDFullDrive(-60)); // list.add(new DistanceDrive(-60, UnitTypes.INCHES)); + list.add(new SetGearGrasp(Value.kForward)); return list; } @@ -72,8 +75,9 @@ public static ArrayList gearPlaceAttemptLeft() { ArrayList list = new ArrayList(); list.add(new PIDFullDrive(-80)); list.add(new PIDAngleDrive(-60)); - // list.add(new PIDFullDrive(-60)); - list.add(new DistanceDrive(-60, UnitTypes.INCHES)); + list.add(new PIDFullDrive(-60)); + // list.add(new DistanceDrive(-60, UnitTypes.INCHES)); + list.add(new SetGearGrasp(Value.kForward)); return list; } } From 89f432d9e08fd228b3fa122b9759ea77971f9445 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:29:56 -0400 Subject: [PATCH 107/121] Create SetGearGrasp command --- .../robot/commands/auto/SetGearGrasp.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java new file mode 100644 index 0000000..b8b7d52 --- /dev/null +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java @@ -0,0 +1,44 @@ +package org.usfirst.frc.team3494.robot.commands.auto; + +import org.usfirst.frc.team3494.robot.Robot; + +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; +import edu.wpi.first.wpilibj.command.Command; + +/** + * + */ +public class SetGearGrasp extends Command { + + private Value v; + + public SetGearGrasp(Value val) { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + this.requires(Robot.gearTake); + this.v = val; + } + + // Called just before this Command runs the first time + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + Robot.gearTake.setGrasp(v); + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return true; + } + + // Called once after isFinished returns true + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } +} From fdb4c8a5e818f85479419d76649ff0ec373355c1 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 17:30:18 -0400 Subject: [PATCH 108/121] Set grasp at beginning of teleop --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 3941dd3..a611dc1 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -23,6 +23,7 @@ import edu.wpi.cscore.UsbCamera; import edu.wpi.cscore.VideoCamera; import edu.wpi.first.wpilibj.CameraServer; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.IterativeRobot; import edu.wpi.first.wpilibj.PowerDistributionPanel; import edu.wpi.first.wpilibj.Preferences; @@ -236,6 +237,7 @@ public void autonomousPeriodic() { @Override public void teleopInit() { + Robot.gearTake.setGrasp(Value.kOff); // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove From 41c9ea62d63a469dd11cf2c61c16d788f53f68b8 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 18:02:20 -0400 Subject: [PATCH 109/121] Fix camera being too dark --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index a611dc1..23e9572 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -177,8 +177,6 @@ public void disabledPeriodic() { */ @Override public void autonomousInit() { - camera_0.setExposureManual(15); - camera_0.setWhiteBalanceManual(VideoCamera.WhiteBalance.kFixedIndoor); autonomousCommand = chooser.getSelected(); // schedule the autonomous command (example) if (autonomousCommand != null) { @@ -245,7 +243,7 @@ public void teleopInit() { if (autonomousCommand != null) { autonomousCommand.cancel(); } - camera_0.setExposureManual(50); + camera_0.setExposureAuto(); camera_0.setWhiteBalanceAuto(); // set ramps for (CANTalon t : Robot.driveTrain.leftSide) { From 592b0a46a67dda92b618c675bca30c76308434c0 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 18:02:45 -0400 Subject: [PATCH 110/121] Map talon reset delay --- .../src/org/usfirst/frc/team3494/robot/RobotMap.java | 2 ++ .../frc/team3494/robot/commands/auto/DistanceDrive.java | 3 ++- .../usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java index dd892d0..88f9b0d 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java @@ -64,4 +64,6 @@ public class RobotMap { // single piston gear holder public static final int MONO_GEAR_FORWARD = 10; public static final int MONO_GEAR_REVERSE = 11; + + public static final long TALON_RESET_DELAY = 100; } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java index 0f43fd6..ddf7167 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.java @@ -1,6 +1,7 @@ package org.usfirst.frc.team3494.robot.commands.auto; import org.usfirst.frc.team3494.robot.Robot; +import org.usfirst.frc.team3494.robot.RobotMap; import org.usfirst.frc.team3494.robot.UnitTypes; import edu.wpi.first.wpilibj.command.Command; @@ -40,7 +41,7 @@ protected void initialize() { Robot.driveTrain.resetRight(); Robot.driveTrain.resetLeft(); try { - Thread.sleep((long) 5); + Thread.sleep(RobotMap.TALON_RESET_DELAY); } catch (InterruptedException e) { System.out.println("ah crap"); e.printStackTrace(); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index 2da421c..feaf9c6 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -1,6 +1,7 @@ package org.usfirst.frc.team3494.robot.commands.auto; import org.usfirst.frc.team3494.robot.Robot; +import org.usfirst.frc.team3494.robot.RobotMap; import org.usfirst.frc.team3494.robot.UnitTypes; import edu.wpi.first.wpilibj.command.Command; @@ -46,7 +47,7 @@ protected void initialize() { Robot.driveTrain.resetLeft(); Robot.driveTrain.resetRight(); try { - Thread.sleep((long) 5); + Thread.sleep(RobotMap.TALON_RESET_DELAY); } catch (InterruptedException e) { System.out.println("ah crap"); e.printStackTrace(); From 09eb32b137caafe97ee2927eaad7d5b844f62c62 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Fri, 24 Mar 2017 18:03:03 -0400 Subject: [PATCH 111/121] Add center gear placer --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index f93b457..d4f81f7 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -53,11 +53,11 @@ public static ArrayList crossBaseLine() { public static ArrayList placeCenterGear() { ArrayList list = new ArrayList(); - list.add(new DistanceDrive(-111 / 2, UnitTypes.INCHES)); + list.add(new PIDFullDrive(-111 / 2)); list.add(new ToggleGearPosition()); list.add(new ToggleGearRamp()); list.add(new DelayCommand(250)); - list.add(new DistanceDrive(10, UnitTypes.INCHES)); + list.add(new PIDFullDrive(10)); return list; } @@ -74,7 +74,7 @@ public static ArrayList gearPlaceAttempt() { public static ArrayList gearPlaceAttemptLeft() { ArrayList list = new ArrayList(); list.add(new PIDFullDrive(-80)); - list.add(new PIDAngleDrive(-60)); + list.add(new PIDAngleDrive(-65)); list.add(new PIDFullDrive(-60)); // list.add(new DistanceDrive(-60, UnitTypes.INCHES)); list.add(new SetGearGrasp(Value.kForward)); From 3eb552860baf037a0d0a7ca262308a63a255a429 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 08:35:05 -0400 Subject: [PATCH 112/121] Change a distance --- .../src/org/usfirst/frc/team3494/robot/AutoGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index d4f81f7..e0bee4a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -53,7 +53,7 @@ public static ArrayList crossBaseLine() { public static ArrayList placeCenterGear() { ArrayList list = new ArrayList(); - list.add(new PIDFullDrive(-111 / 2)); + list.add(new PIDFullDrive(-110.5)); list.add(new ToggleGearPosition()); list.add(new ToggleGearRamp()); list.add(new DelayCommand(250)); From e162591c8fafa531444c61cc17aef26e163e0ac1 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 09:15:49 -0400 Subject: [PATCH 113/121] Remove unused import --- 3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java | 1 - 1 file changed, 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 23e9572..6d3057f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -21,7 +21,6 @@ import com.kauailabs.navx.frc.AHRS; import edu.wpi.cscore.UsbCamera; -import edu.wpi.cscore.VideoCamera; import edu.wpi.first.wpilibj.CameraServer; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.IterativeRobot; From 9aaa1990c17771128e1c1bb95be5c4c3af594f9b Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 09:25:46 -0400 Subject: [PATCH 114/121] Format source --- .../frc/team3494/robot/AutoGenerator.java | 2 +- .../usfirst/frc/team3494/robot/RobotMap.java | 2 +- .../robot/commands/auto/SetGearGrasp.java | 65 ++++++++++--------- 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index e0bee4a..4838109 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -70,7 +70,7 @@ public static ArrayList gearPlaceAttempt() { list.add(new SetGearGrasp(Value.kForward)); return list; } - + public static ArrayList gearPlaceAttemptLeft() { ArrayList list = new ArrayList(); list.add(new PIDFullDrive(-80)); diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java index 88f9b0d..4a80078 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/RobotMap.java @@ -64,6 +64,6 @@ public class RobotMap { // single piston gear holder public static final int MONO_GEAR_FORWARD = 10; public static final int MONO_GEAR_REVERSE = 11; - + public static final long TALON_RESET_DELAY = 100; } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java index b8b7d52..976dc0e 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.java @@ -11,34 +11,39 @@ public class SetGearGrasp extends Command { private Value v; - - public SetGearGrasp(Value val) { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - this.requires(Robot.gearTake); - this.v = val; - } - - // Called just before this Command runs the first time - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - Robot.gearTake.setGrasp(v); - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } + + public SetGearGrasp(Value val) { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + this.requires(Robot.gearTake); + this.v = val; + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + Robot.gearTake.setGrasp(v); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return true; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } } From 0c9b369dc83baca1742e54855118991b77a2bce7 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 09:57:36 -0400 Subject: [PATCH 115/121] Add a method for tank driving in teleoperated --- .../frc/team3494/robot/commands/drive/Drive.java | 2 +- .../frc/team3494/robot/subsystems/Drivetrain.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 8e0ffd6..f58cb4a 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -68,7 +68,7 @@ protected void execute() { } } } else { - Robot.driveTrain.TankDrive(-Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); + Robot.driveTrain.TeleopTank(Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index d43d06c..4017469 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -175,6 +175,17 @@ public void TankDrive(double left, double right) { this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale); this.driveRightFollower_Two.set(right * this.scaleDown * rightScale); } + + public void TeleopTank(double left, double right) { + double leftScale = Robot.prefs.getDouble("left side multiplier", 1.0D); + double rightScale = Robot.prefs.getDouble("right side multiplier", 1.0D); + this.driveLeftMaster.set(left * this.scaleDown * leftScale * this.inverter); + this.driveRightMaster.set(right * this.scaleDown * rightScale * this.inverter); + this.driveLeftFollower_One.set(left * this.scaleDown * leftScale * this.inverter); + this.driveRightFollower_One.set(right * this.scaleDown * rightScale * this.inverter); + this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale * this.inverter); + this.driveRightFollower_Two.set(right * this.scaleDown * rightScale * this.inverter); + } /** * Drives the drivetrain, with the value passed in for left inverted. This From f8ea93069004de06eeead085913b284cc9abe849 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 09:57:36 -0400 Subject: [PATCH 116/121] Revert "Add a method for tank driving in teleoperated" This reverts commit 0c9b369dc83baca1742e54855118991b77a2bce7. --- .../frc/team3494/robot/commands/drive/Drive.java | 2 +- .../frc/team3494/robot/subsystems/Drivetrain.java | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index f58cb4a..8e0ffd6 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -68,7 +68,7 @@ protected void execute() { } } } else { - Robot.driveTrain.TeleopTank(Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); + Robot.driveTrain.TankDrive(-Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 4017469..d43d06c 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -175,17 +175,6 @@ public void TankDrive(double left, double right) { this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale); this.driveRightFollower_Two.set(right * this.scaleDown * rightScale); } - - public void TeleopTank(double left, double right) { - double leftScale = Robot.prefs.getDouble("left side multiplier", 1.0D); - double rightScale = Robot.prefs.getDouble("right side multiplier", 1.0D); - this.driveLeftMaster.set(left * this.scaleDown * leftScale * this.inverter); - this.driveRightMaster.set(right * this.scaleDown * rightScale * this.inverter); - this.driveLeftFollower_One.set(left * this.scaleDown * leftScale * this.inverter); - this.driveRightFollower_One.set(right * this.scaleDown * rightScale * this.inverter); - this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale * this.inverter); - this.driveRightFollower_Two.set(right * this.scaleDown * rightScale * this.inverter); - } /** * Drives the drivetrain, with the value passed in for left inverted. This From bae5bc16237b331362e3332c8c77e5f0d1585453 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 10:11:08 -0400 Subject: [PATCH 117/121] Fix conflicts --- .../org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index d43d06c..6da1b45 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -175,6 +175,10 @@ public void TankDrive(double left, double right) { this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale); this.driveRightFollower_Two.set(right * this.scaleDown * rightScale); } + + public void TeleopTank(double left, double right) { + this.TankDrive(left * this.inverter, right * this.inverter); + } /** * Drives the drivetrain, with the value passed in for left inverted. This From e64d80a45f1680952eee9a7035fe9a88c2db094f Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 10:24:30 -0400 Subject: [PATCH 118/121] *distant screeching* --- .../usfirst/frc/team3494/robot/commands/drive/Drive.java | 6 +++++- .../usfirst/frc/team3494/robot/subsystems/Drivetrain.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java index 8e0ffd6..d2ca781 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/drive/Drive.java @@ -68,7 +68,11 @@ protected void execute() { } } } else { - Robot.driveTrain.TankDrive(-Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); + if (Robot.driveTrain.getInverted()) { + Robot.driveTrain.TankDrive(-Robot.oi.stick_l.getY(), Robot.oi.stick_r.getY()); + } else { + Robot.driveTrain.TankDrive(Robot.oi.stick_r.getY(), -Robot.oi.stick_l.getY()); + } } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java index 6da1b45..c957820 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/subsystems/Drivetrain.java @@ -175,7 +175,7 @@ public void TankDrive(double left, double right) { this.driveLeftFollower_Two.set(left * this.scaleDown * leftScale); this.driveRightFollower_Two.set(right * this.scaleDown * rightScale); } - + public void TeleopTank(double left, double right) { this.TankDrive(left * this.inverter, right * this.inverter); } From b53012da9ed1cc1a7cc52d9ee1e4cbbee672a1ab Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 14:25:31 -0400 Subject: [PATCH 119/121] Allow bi-directional PID drive --- .../frc/team3494/robot/commands/auto/PIDFullDrive.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java index feaf9c6..dd4f862 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.java @@ -63,7 +63,11 @@ protected void execute() { SmartDashboard.putNumber("angle", Robot.ahrs.getAngle()); System.out.println(Robot.ahrs.getYaw()); // System.out.println(Robot.driveTrain.PIDTune); - Robot.driveTrain.ArcadeDrive(0.5, -Robot.driveTrain.PIDTune, true); + if (this.distance < 0) { + Robot.driveTrain.ArcadeDrive(0.5, -Robot.driveTrain.PIDTune, true); + } else { + Robot.driveTrain.ArcadeDrive(-0.5, -Robot.driveTrain.PIDTune, true); + } } // Make this return true when this Command no longer needs to run execute() From 6eff02b6ce6979474dcc22ef87008c13c20574d3 Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Sat, 25 Mar 2017 14:25:43 -0400 Subject: [PATCH 120/121] Add active gear placement --- .../frc/team3494/robot/AutoGenerator.java | 34 +++++++++++-------- .../org/usfirst/frc/team3494/robot/Robot.java | 2 ++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java index 4838109..171a0e5 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java @@ -2,16 +2,12 @@ import java.util.ArrayList; -import org.usfirst.frc.team3494.robot.commands.DelayCommand; import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; import org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive; import org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive; -import org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp; import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; -import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition; import org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp; -import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.command.Command; /** @@ -53,31 +49,39 @@ public static ArrayList crossBaseLine() { public static ArrayList placeCenterGear() { ArrayList list = new ArrayList(); - list.add(new PIDFullDrive(-110.5)); - list.add(new ToggleGearPosition()); - list.add(new ToggleGearRamp()); - list.add(new DelayCommand(250)); - list.add(new PIDFullDrive(10)); + list.add(new PIDFullDrive(110.5)); return list; } public static ArrayList gearPlaceAttempt() { ArrayList list = new ArrayList(); - list.add(new PIDFullDrive(-80)); + list.add(new PIDFullDrive(87.5)); list.add(new PIDAngleDrive(65)); - list.add(new PIDFullDrive(-60)); + list.add(new PIDFullDrive(54)); // list.add(new DistanceDrive(-60, UnitTypes.INCHES)); - list.add(new SetGearGrasp(Value.kForward)); return list; } public static ArrayList gearPlaceAttemptLeft() { ArrayList list = new ArrayList(); - list.add(new PIDFullDrive(-80)); + list.add(new PIDFullDrive(87.5)); list.add(new PIDAngleDrive(-65)); - list.add(new PIDFullDrive(-60)); + list.add(new PIDFullDrive(54)); // list.add(new DistanceDrive(-60, UnitTypes.INCHES)); - list.add(new SetGearGrasp(Value.kForward)); + return list; + } + + public static ArrayList activeLeftGear() { + ArrayList list = AutoGenerator.gearPlaceAttemptLeft(); + list.add(new ToggleGearRamp()); + list.add(new PIDFullDrive(10)); + return list; + } + + public static ArrayList activeGearRight() { + ArrayList list = AutoGenerator.gearPlaceAttempt(); + list.add(new ToggleGearRamp()); + list.add(new PIDFullDrive(-10)); return list; } } diff --git a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java index 6d3057f..892a28f 100644 --- a/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java +++ b/3494_2017_repo/src/org/usfirst/frc/team3494/robot/Robot.java @@ -103,6 +103,8 @@ public void robotInit() { chooser.addObject("Do nothing", new NullAuto()); chooser.addObject("PID Test - turn 90 degrees", new PIDAngleDrive(90)); chooser.addObject("PID Test - drive straight", new PIDFullDrive(36)); + chooser.addObject("Active Gear placer - Robot turn left", new ConstructedAuto(AutoGenerator.activeLeftGear())); + chooser.addObject("Active Gear placer - Robot turn right", new ConstructedAuto(AutoGenerator.activeGearRight())); // put chooser on DS SmartDashboard.putData("AUTO CHOOSER", chooser); // get preferences From 0f91db0f9b00803694d786bec9aedb7c52aaa9ab Mon Sep 17 00:00:00 2001 From: Edwan Vi Date: Tue, 28 Mar 2017 19:20:29 -0400 Subject: [PATCH 121/121] Rebuild JavaDocs --- docs/allclasses-frame.html | 22 +- docs/allclasses-noframe.html | 22 +- docs/constant-values.html | 63 ++- docs/deprecated-list.html | 4 +- docs/help-doc.html | 4 +- docs/index-files/index-1.html | 10 +- docs/index-files/index-10.html | 6 +- docs/index-files/index-11.html | 14 +- docs/index-files/index-12.html | 4 +- docs/index-files/index-13.html | 18 +- docs/index-files/index-14.html | 26 +- docs/index-files/index-15.html | 34 +- docs/index-files/index-16.html | 44 +- docs/index-files/index-17.html | 8 +- docs/index-files/index-18.html | 6 +- docs/index-files/index-19.html | 10 +- docs/index-files/index-2.html | 10 +- docs/index-files/index-20.html | 4 +- docs/index-files/index-21.html | 4 +- docs/index-files/index-3.html | 6 +- docs/index-files/index-4.html | 40 +- docs/index-files/index-5.html | 46 +- docs/index-files/index-6.html | 32 +- docs/index-files/index-7.html | 18 +- docs/index-files/index-8.html | 76 ++- docs/index-files/index-9.html | 4 +- docs/index.html | 2 +- .../frc/team3494/robot/AutoGenerator.html | 53 +- .../frc/team3494/robot/DriveDirections.html | 4 +- docs/org/usfirst/frc/team3494/robot/OI.html | 30 +- .../org/usfirst/frc/team3494/robot/Robot.html | 31 +- .../usfirst/frc/team3494/robot/RobotMap.html | 125 +++-- .../usfirst/frc/team3494/robot/UnitTypes.html | 4 +- .../robot/class-use/AutoGenerator.html | 4 +- .../robot/class-use/DriveDirections.html | 4 +- .../frc/team3494/robot/class-use/OI.html | 4 +- .../frc/team3494/robot/class-use/Robot.html | 4 +- .../team3494/robot/class-use/RobotMap.html | 4 +- .../team3494/robot/class-use/UnitTypes.html | 4 +- .../team3494/robot/commands/DelayCommand.html | 4 +- .../robot/commands/auto/AngleTurn.html | 4 +- .../robot/commands/auto/ConstructedAuto.html | 4 +- .../robot/commands/auto/DistanceDrive.html | 4 +- .../robot/commands/auto/NullAuto.html | 4 +- .../robot/commands/auto/PIDAngleDrive.html | 8 +- .../robot/commands/auto/PIDFullDrive.html | 439 ++++++++++++++++ .../robot/commands/auto/SetGearGrasp.html | 395 ++++++++++++++ .../team3494/robot/commands/auto/XYDrive.html | 8 +- .../commands/auto/class-use/AngleTurn.html | 4 +- .../auto/class-use/ConstructedAuto.html | 4 +- .../auto/class-use/DistanceDrive.html | 4 +- .../commands/auto/class-use/NullAuto.html | 4 +- .../auto/class-use/PIDAngleDrive.html | 4 +- .../commands/auto/class-use/PIDFullDrive.html | 124 +++++ .../commands/auto/class-use/SetGearGrasp.html | 124 +++++ .../commands/auto/class-use/XYDrive.html | 4 +- .../robot/commands/auto/package-frame.html | 8 +- .../robot/commands/auto/package-summary.html | 14 +- .../robot/commands/auto/package-tree.html | 12 +- .../robot/commands/auto/package-use.html | 4 +- .../robot/commands/auto/tests/SpeedTest.html | 360 +++++++++++++ .../robot/commands/auto/tests/StageTest.html | 396 ++++++++++++++ .../auto/tests/class-use/SpeedTest.html | 124 +++++ .../auto/tests/class-use/StageTest.html | 124 +++++ .../commands/auto/tests/package-frame.html | 21 + .../commands/auto/tests/package-summary.html | 160 ++++++ .../commands/auto/tests/package-tree.html | 142 +++++ .../commands/auto/tests/package-use.html | 124 +++++ .../commands/class-use/DelayCommand.html | 4 +- .../team3494/robot/commands/climb/Climb.html | 4 +- .../robot/commands/climb/ClimberToggle.html | 4 +- .../robot/commands/climb/StopClimber.html | 4 +- .../robot/commands/climb/class-use/Climb.html | 4 +- .../climb/class-use/ClimberToggle.html | 4 +- .../commands/climb/class-use/StopClimber.html | 4 +- .../robot/commands/climb/package-frame.html | 4 +- .../robot/commands/climb/package-summary.html | 8 +- .../robot/commands/climb/package-tree.html | 8 +- .../robot/commands/climb/package-use.html | 4 +- .../team3494/robot/commands/drive/Drive.html | 4 +- .../robot/commands/drive/HoldDriveTrain.html | 4 +- .../robot/commands/drive/class-use/Drive.html | 4 +- .../drive/class-use/HoldDriveTrain.html | 4 +- .../robot/commands/drive/package-frame.html | 4 +- .../robot/commands/drive/package-summary.html | 4 +- .../robot/commands/drive/package-tree.html | 4 +- .../robot/commands/drive/package-use.html | 4 +- .../commands/gears/HoldInState_Forward.html | 360 +++++++++++++ .../robot/commands/gears/SetReverse.html | 359 +++++++++++++ .../commands/gears/ToggleGearPosition.html | 8 +- .../robot/commands/gears/ToggleGearRamp.html | 4 +- .../gears/class-use/HoldInState_Forward.html | 124 +++++ .../commands/gears/class-use/SetReverse.html | 124 +++++ .../gears/class-use/ToggleGearPosition.html | 4 +- .../gears/class-use/ToggleGearRamp.html | 4 +- .../robot/commands/gears/package-frame.html | 7 +- .../robot/commands/gears/package-summary.html | 16 +- .../robot/commands/gears/package-tree.html | 11 +- .../robot/commands/gears/package-use.html | 4 +- .../robot/commands/package-frame.html | 4 +- .../robot/commands/package-summary.html | 4 +- .../team3494/robot/commands/package-tree.html | 4 +- .../team3494/robot/commands/package-use.html | 4 +- .../team3494/robot/commands/turret/Shoot.html | 4 +- .../robot/commands/turret/TurretCon.html | 4 +- .../commands/turret/class-use/Shoot.html | 4 +- .../commands/turret/class-use/TurretCon.html | 4 +- .../robot/commands/turret/package-frame.html | 4 +- .../commands/turret/package-summary.html | 8 +- .../robot/commands/turret/package-tree.html | 8 +- .../robot/commands/turret/package-use.html | 4 +- .../frc/team3494/robot/package-frame.html | 4 +- .../frc/team3494/robot/package-summary.html | 4 +- .../frc/team3494/robot/package-tree.html | 4 +- .../frc/team3494/robot/package-use.html | 4 +- .../frc/team3494/robot/sensors/LineBreak.html | 4 +- .../robot/sensors/class-use/LineBreak.html | 6 +- .../team3494/robot/sensors/package-frame.html | 4 +- .../robot/sensors/package-summary.html | 4 +- .../team3494/robot/sensors/package-tree.html | 4 +- .../team3494/robot/sensors/package-use.html | 4 +- .../team3494/robot/subsystems/Climber.html | 4 +- .../team3494/robot/subsystems/Conveyer.html | 4 +- .../team3494/robot/subsystems/Drivetrain.html | 51 +- .../team3494/robot/subsystems/GearTake_2.html | 491 ++++++++++++++++++ .../robot/subsystems/IMotorizedSubsystem.html | 14 +- .../team3494/robot/subsystems/Kompressor.html | 12 +- .../robot/subsystems/MonoGearTake.html | 354 +++++++++++++ .../frc/team3494/robot/subsystems/Turret.html | 8 +- .../robot/subsystems/TurretEncoders.html | 4 +- .../robot/subsystems/class-use/Climber.html | 4 +- .../robot/subsystems/class-use/Conveyer.html | 4 +- .../subsystems/class-use/Drivetrain.html | 4 +- .../subsystems/class-use/GearTake_2.html | 164 ++++++ .../class-use/IMotorizedSubsystem.html | 10 +- .../subsystems/class-use/Kompressor.html | 4 +- .../subsystems/class-use/MonoGearTake.html | 124 +++++ .../robot/subsystems/class-use/Turret.html | 4 +- .../subsystems/class-use/TurretEncoders.html | 4 +- .../robot/subsystems/package-frame.html | 8 +- .../robot/subsystems/package-summary.html | 18 +- .../robot/subsystems/package-tree.html | 12 +- .../robot/subsystems/package-use.html | 13 +- .../team3494/robot/vision/GearPipeline.html | 6 +- .../team3494/robot/vision/GripPipeline.html | 4 +- .../team3494/robot/vision/VisionUtils.html | 4 +- .../robot/vision/class-use/GearPipeline.html | 4 +- .../robot/vision/class-use/GripPipeline.html | 4 +- .../robot/vision/class-use/VisionUtils.html | 4 +- .../team3494/robot/vision/package-frame.html | 4 +- .../robot/vision/package-summary.html | 4 +- .../team3494/robot/vision/package-tree.html | 4 +- .../team3494/robot/vision/package-use.html | 4 +- docs/overview-frame.html | 7 +- docs/overview-summary.html | 24 +- docs/overview-tree.html | 27 +- docs/package-list | 3 +- 157 files changed, 5463 insertions(+), 601 deletions(-) create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/PIDFullDrive.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/SetGearGrasp.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/class-use/PIDFullDrive.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/class-use/SetGearGrasp.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/SpeedTest.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/StageTest.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/class-use/SpeedTest.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/class-use/StageTest.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/package-frame.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/package-summary.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/package-tree.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/auto/tests/package-use.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/gears/HoldInState_Forward.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/gears/SetReverse.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/gears/class-use/HoldInState_Forward.html create mode 100644 docs/org/usfirst/frc/team3494/robot/commands/gears/class-use/SetReverse.html create mode 100644 docs/org/usfirst/frc/team3494/robot/subsystems/GearTake_2.html create mode 100644 docs/org/usfirst/frc/team3494/robot/subsystems/MonoGearTake.html create mode 100644 docs/org/usfirst/frc/team3494/robot/subsystems/class-use/GearTake_2.html create mode 100644 docs/org/usfirst/frc/team3494/robot/subsystems/class-use/MonoGearTake.html diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index 1117103..27f3d7b 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -24,30 +24,34 @@

      All Classes

    • Drive
    • DriveDirections
    • Drivetrain
    • -
    • GearTake
    • +
    • GearPipeline
    • +
    • GearTake_2
    • +
    • GripPipeline
    • HoldDriveTrain
    • -
    • HoldInState
    • +
    • HoldInState_Forward
    • IMotorizedSubsystem
    • -
    • Intake
    • Kompressor
    • LineBreak
    • +
    • MonoGearTake
    • NullAuto
    • OI
    • PIDAngleDrive
    • -
    • PIDStraightDrive
    • +
    • PIDFullDrive
    • Robot
    • RobotMap
    • -
    • RunIntake
    • +
    • SetGearGrasp
    • +
    • SetReverse
    • Shoot
    • -
    • StageTest
    • +
    • SpeedTest
    • +
    • StageTest
    • StopClimber
    • -
    • SwitchPosition
    • ToggleGearPosition
    • ToggleGearRamp
    • Turret
    • TurretCon
    • TurretEncoders
    • UnitTypes
    • +
    • VisionUtils
    • XYDrive
  • diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index 212694f..e7a084e 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -24,30 +24,34 @@

    All Classes

  • Drive
  • DriveDirections
  • Drivetrain
  • -
  • GearTake
  • +
  • GearPipeline
  • +
  • GearTake_2
  • +
  • GripPipeline
  • HoldDriveTrain
  • -
  • HoldInState
  • +
  • HoldInState_Forward
  • IMotorizedSubsystem
  • -
  • Intake
  • Kompressor
  • LineBreak
  • +
  • MonoGearTake
  • NullAuto
  • OI
  • PIDAngleDrive
  • -
  • PIDStraightDrive
  • +
  • PIDFullDrive
  • Robot
  • RobotMap
  • -
  • RunIntake
  • +
  • SetGearGrasp
  • +
  • SetReverse
  • Shoot
  • -
  • StageTest
  • +
  • SpeedTest
  • +
  • StageTest
  • StopClimber
  • -
  • SwitchPosition
  • ToggleGearPosition
  • ToggleGearRamp
  • Turret
  • TurretCon
  • TurretEncoders
  • UnitTypes
  • +
  • VisionUtils
  • XYDrive
  • diff --git a/docs/constant-values.html b/docs/constant-values.html index 932a525..89492a4 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + @@ -208,6 +208,20 @@

    org.usfirst.*

    5 + + +public static final int +GEAR_GRASP_S2_BACKWARD +0 + + + + +public static final int +GEAR_GRASP_S2_FORWARD +1 + + public static final int @@ -229,20 +243,6 @@

    org.usfirst.*

    5 - - -public static final int -INTAKE_PISTON_CHONE -0 - - - - -public static final int -INTAKE_PISTON_CHTWO -1 - - public static final int @@ -264,6 +264,20 @@

    org.usfirst.*

    1 + + +public static final int +MONO_GEAR_FORWARD +10 + + + + +public static final int +MONO_GEAR_REVERSE +11 + + public static final int @@ -285,41 +299,48 @@

    org.usfirst.*

    14 + + +public static final long +TALON_RESET_DELAY +100L + + public static final int TURRET_LOWER 63 - + public static final int TURRET_RING 62 - + public static final int TURRET_UPPER 64 - + public static final int UP_MOTOR 4 - + public static final int XBOX_ONE 0 - + public static final int diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index 01db554..371bd04 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List - + diff --git a/docs/help-doc.html b/docs/help-doc.html index 4fa243f..8c19820 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,9 +2,9 @@ - + API Help - + diff --git a/docs/index-files/index-1.html b/docs/index-files/index-1.html index 3c60dc3..0bd121f 100644 --- a/docs/index-files/index-1.html +++ b/docs/index-files/index-1.html @@ -2,9 +2,9 @@ - + A-Index - + @@ -76,6 +76,10 @@

    A

    absolutelyAverage - Variable in class org.usfirst.frc.team3494.robot.Robot
     
    +
    activeGearRight() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
    +
     
    +
    activeLeftGear() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
    +
     
    adjustedTankDrive(double, double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    Drives the drivetrain, with the value passed in for left inverted.
    @@ -92,7 +96,7 @@

    A

     
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
     
    -
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
     
    angle - Variable in class org.usfirst.frc.team3494.robot.commands.auto.XYDrive
     
    diff --git a/docs/index-files/index-10.html b/docs/index-files/index-10.html index 6f5dd42..dbd5c7a 100644 --- a/docs/index-files/index-10.html +++ b/docs/index-files/index-10.html @@ -2,9 +2,9 @@ - + L-Index - + @@ -74,7 +74,7 @@

    L

    -
    lb - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    lb - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
     
    leftSide - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    diff --git a/docs/index-files/index-11.html b/docs/index-files/index-11.html index 74ee963..0345996 100644 --- a/docs/index-files/index-11.html +++ b/docs/index-files/index-11.html @@ -2,9 +2,9 @@ - + M-Index - + @@ -74,6 +74,16 @@

    M

    +
    MONO_GEAR_FORWARD - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    +
    MONO_GEAR_REVERSE - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    +
    MonoGearTake - Class in org.usfirst.frc.team3494.robot.subsystems
    +
    +
    Single piston gear holder.
    +
    +
    MonoGearTake() - Constructor for class org.usfirst.frc.team3494.robot.subsystems.MonoGearTake
    +
     
    motor - Variable in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html index 97b3995..01c4864 100644 --- a/docs/index-files/index-12.html +++ b/docs/index-files/index-12.html @@ -2,9 +2,9 @@ - + N-Index - + diff --git a/docs/index-files/index-13.html b/docs/index-files/index-13.html index 1935abf..c3ff39b 100644 --- a/docs/index-files/index-13.html +++ b/docs/index-files/index-13.html @@ -2,9 +2,9 @@ - + O-Index - + @@ -83,7 +83,9 @@

    O

     
    oi - Static variable in class org.usfirst.frc.team3494.robot.Robot
     
    -
    openandclose - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    openandclose_backward - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    +
     
    +
    openandclose_forward - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    The solenoid that holds the gear or drops it.
    @@ -95,6 +97,10 @@

    O

    org.usfirst.frc.team3494.robot.commands.auto - package org.usfirst.frc.team3494.robot.commands.auto
     
    +
    org.usfirst.frc.team3494.robot.commands.auto.tests - package org.usfirst.frc.team3494.robot.commands.auto.tests
    +
    +
    Package for holding auto codes that exist solely as tests (i.e.
    +
    org.usfirst.frc.team3494.robot.commands.climb - package org.usfirst.frc.team3494.robot.commands.climb
     
    org.usfirst.frc.team3494.robot.commands.drive - package org.usfirst.frc.team3494.robot.commands.drive
    @@ -106,10 +112,6 @@

    O

    Package for all things gear holder that aren't auto-specific (put those in the auto package.)
    -
    org.usfirst.frc.team3494.robot.commands.intake - package org.usfirst.frc.team3494.robot.commands.intake
    -
    -
    Package for intake-related commands.
    -
    org.usfirst.frc.team3494.robot.commands.turret - package org.usfirst.frc.team3494.robot.commands.turret
    Turret related packages.
    @@ -120,6 +122,8 @@

    O

    org.usfirst.frc.team3494.robot.subsystems - package org.usfirst.frc.team3494.robot.subsystems
     
    +
    org.usfirst.frc.team3494.robot.vision - package org.usfirst.frc.team3494.robot.vision
    +
     
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-14.html b/docs/index-files/index-14.html index 3e22736..3d828ab 100644 --- a/docs/index-files/index-14.html +++ b/docs/index-files/index-14.html @@ -2,9 +2,9 @@ - + P-Index - + @@ -84,21 +84,21 @@

    P

    Constructor.
    -
    PIDStraightDrive - Class in org.usfirst.frc.team3494.robot.commands.auto
    +
    PIDFullDrive - Class in org.usfirst.frc.team3494.robot.commands.auto
    -
    Drives straight using the drivetrain's PID loop.
    +
    Drives straight/forward with an angle (WIP) using the drivetrain's PID loop.
    -
    PIDStraightDrive(double, double) - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    PIDFullDrive(double, double) - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    Constructor.
    -
    PIDStraightDrive(double) - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    PIDFullDrive(double) - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    Other constructor.
    PIDTune - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    -
    piston - Variable in class org.usfirst.frc.team3494.robot.subsystems.Intake
    +
    piston - Variable in class org.usfirst.frc.team3494.robot.subsystems.MonoGearTake
     
    placeCenterGear() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
     
    @@ -106,10 +106,18 @@

    P

     
    prefs - Static variable in class org.usfirst.frc.team3494.robot.Robot
     
    +
    process(Mat) - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    This is the primary method that runs the entire pipeline and updates the + outputs.
    +
    +
    process(Mat) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    This is the primary method that runs the entire pipeline and updates the + outputs.
    +
    pto - Variable in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    -
    pushForward() - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-15.html b/docs/index-files/index-15.html index 2d8c7be..3508251 100644 --- a/docs/index-files/index-15.html +++ b/docs/index-files/index-15.html @@ -2,9 +2,9 @@ - + R-Index - + @@ -76,13 +76,13 @@

    R

    RAMP - Static variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    -
    rampenoid - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    rampenoid - Variable in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    The solenoid that controls the ramp on the gear intake.
    -
    releaseGear() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    releaseGear() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    - +
    resetLeft() - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    @@ -92,10 +92,18 @@

    R

    Resets the encoder on the right side of the drivetrain.
    -
    retract() - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    returnPIDInput() - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    +
    rgbThreshold(Mat, double[], double[], double[], Mat) - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    Segment an image based on color ranges.
    +
    +
    rgbThresholdOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
     
    +
    rgbThresholdOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    This method is a generated getter for the output of a RGB_Threshold.
    +
    rightSide - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    rightTalonOne - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    @@ -124,20 +132,12 @@

    R

    RobotMap() - Constructor for class org.usfirst.frc.team3494.robot.RobotMap
     
    +
    rotate(Mat, double) - Static method in class org.usfirst.frc.team3494.robot.vision.VisionUtils
    +
     
    runConveyer(DriveDirections) - Method in class org.usfirst.frc.team3494.robot.subsystems.Conveyer
    Runs the conveyer in the specified direction.
    -
    RunIntake - Class in org.usfirst.frc.team3494.robot.commands.intake
    -
    -
    Runs the intake.
    -
    -
    RunIntake() - Constructor for class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    -
    runIntake(double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    -
    running - Variable in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-16.html b/docs/index-files/index-16.html index bb8125a..4dcae72 100644 --- a/docs/index-files/index-16.html +++ b/docs/index-files/index-16.html @@ -2,9 +2,9 @@ - + S-Index - + @@ -86,26 +86,32 @@

    S

    Sets all motors on a subsystem to a given speed.
    -
    setAll(double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    setAll(double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    -
    setGrasp(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    SetGearGrasp - Class in org.usfirst.frc.team3494.robot.commands.auto
    +
     
    +
    SetGearGrasp(DoubleSolenoid.Value) - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
    +
     
    +
    setGrasp(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    Sets the position of the actual gear holder.
    setHood(double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    -
    setPiston(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    +
    setPos(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.MonoGearTake
     
    setPTO(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.Climber
    Engages or disengages the drivetrain from the climber.
    -
    setRamp(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    setRamp(DoubleSolenoid.Value) - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    Sets the position of the intake ramp.
    +
    SetReverse - Class in org.usfirst.frc.team3494.robot.commands.gears
    +
     
    +
    SetReverse() - Constructor for class org.usfirst.frc.team3494.robot.commands.gears.SetReverse
    +
     
    Shoot - Class in org.usfirst.frc.team3494.robot.commands.turret
    Command to run the shooter off of OI input.
    @@ -128,15 +134,25 @@

    S

     
    snapBackToReality() - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    -
    speed - Variable in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    +
    SpeedTest - Class in org.usfirst.frc.team3494.robot.commands.auto.tests
    +
    +
    Test for CAN Talon speed mode.
    +
    +
    SpeedTest() - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest
     
    stagedTankDrive(double, double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    Stage-sets the drivetrain.
    -
    StageTest - Class in org.usfirst.frc.team3494.robot.commands.auto
    +
    StageTest - Class in org.usfirst.frc.team3494.robot.commands.auto.tests
    +
    +
    Chris made me do it
    +
    +
    StageTest() - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    -
    StageTest() - Constructor for class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    stick_l - Variable in class org.usfirst.frc.team3494.robot.OI
    +
     
    +
    stick_r - Variable in class org.usfirst.frc.team3494.robot.OI
     
    stopAll() - Method in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    @@ -148,8 +164,6 @@

    S

    Stop all motors on the subsystem.
    -
    stopAll() - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    stopAll() - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    StopClimber - Class in org.usfirst.frc.team3494.robot.commands.climb
    @@ -163,12 +177,6 @@

    S

     
    stopTurret() - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    -
    SwitchPosition - Class in org.usfirst.frc.team3494.robot.commands.intake
    -
    -
    Deploys the intake for the start of teleop.
    -
    -
    SwitchPosition() - Constructor for class org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
    -
     
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-17.html b/docs/index-files/index-17.html index df881c2..a0b8e89 100644 --- a/docs/index-files/index-17.html +++ b/docs/index-files/index-17.html @@ -2,9 +2,9 @@ - + T-Index - + @@ -74,6 +74,8 @@

    T

    +
    TALON_RESET_DELAY - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    TankDrive(double, double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    Drives the drivetrain tank drive style.
    @@ -84,6 +86,8 @@

    T

    This function is called periodically during operator control.
    +
    TeleopTank(double, double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    +
     
    testPeriodic() - Method in class org.usfirst.frc.team3494.robot.Robot
    This function is called periodically during test mode
    diff --git a/docs/index-files/index-18.html b/docs/index-files/index-18.html index 9e36565..90e1f18 100644 --- a/docs/index-files/index-18.html +++ b/docs/index-files/index-18.html @@ -2,9 +2,9 @@ - + U-Index - + @@ -84,8 +84,6 @@

    U

     
    UP_MOTOR - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    -
    upMotor - Variable in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    usePIDOutput(double) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    diff --git a/docs/index-files/index-19.html b/docs/index-files/index-19.html index d33471e..754aed1 100644 --- a/docs/index-files/index-19.html +++ b/docs/index-files/index-19.html @@ -2,9 +2,9 @@ - + V-Index - + @@ -74,6 +74,8 @@

    V

    +
    v - Variable in class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
    +
     
    valueOf(String) - Static method in enum org.usfirst.frc.team3494.robot.DriveDirections
    Returns the enum constant of this type with the specified name.
    @@ -103,6 +105,10 @@

    V

    visionThread - Variable in class org.usfirst.frc.team3494.robot.Robot
     
    +
    VisionUtils - Class in org.usfirst.frc.team3494.robot.vision
    +
     
    +
    VisionUtils() - Constructor for class org.usfirst.frc.team3494.robot.vision.VisionUtils
    +
     
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-2.html b/docs/index-files/index-2.html index cc14f41..e90e4db 100644 --- a/docs/index-files/index-2.html +++ b/docs/index-files/index-2.html @@ -2,9 +2,9 @@ - + C-Index - + @@ -116,9 +116,9 @@

    C

    ClimberToggle() - Constructor for class org.usfirst.frc.team3494.robot.commands.climb.ClimberToggle
     
    -
    closeHolder() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    closeHolder() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    - +
    compress - Variable in class org.usfirst.frc.team3494.robot.subsystems.Kompressor
     
    @@ -142,7 +142,7 @@

    C

     
    CONVEYER_M - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    -
    counter - Variable in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    counter - Variable in class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    crossBaseLine() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
    diff --git a/docs/index-files/index-20.html b/docs/index-files/index-20.html index 6b5fc6b..6c5932e 100644 --- a/docs/index-files/index-20.html +++ b/docs/index-files/index-20.html @@ -2,9 +2,9 @@ - + W-Index - + diff --git a/docs/index-files/index-21.html b/docs/index-files/index-21.html index 4edf03a..54b7f70 100644 --- a/docs/index-files/index-21.html +++ b/docs/index-files/index-21.html @@ -2,9 +2,9 @@ - + X-Index - + diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html index 38104f5..bf4a7d9 100644 --- a/docs/index-files/index-3.html +++ b/docs/index-files/index-3.html @@ -2,9 +2,9 @@ - + D-Index - + @@ -94,7 +94,7 @@

    D

     
    dist - Variable in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
     
    -
    distance - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    distance - Variable in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
     
    DistanceDrive - Class in org.usfirst.frc.team3494.robot.commands.auto
    diff --git a/docs/index-files/index-4.html b/docs/index-files/index-4.html index 054a451..3f9015a 100644 --- a/docs/index-files/index-4.html +++ b/docs/index-files/index-4.html @@ -2,9 +2,9 @@ - + E-Index - + @@ -74,8 +74,6 @@

    E

    -
    encLeft - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    -
     
    ENCODER_LEFT_A - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    ENCODER_LEFT_B - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    @@ -84,8 +82,6 @@

    E

     
    ENCODER_RIGHT_B - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    -
    encRight - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
    -
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.AngleTurn
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
    @@ -94,9 +90,13 @@

    E

     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
     
    -
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    +
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
     
    -
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest
    +
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    @@ -110,16 +110,14 @@

    E

     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    -
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward
    +
     
    +
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetReverse
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    -
    end() - Method in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    -
    end() - Method in class org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
    -
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.turret.Shoot
     
    end() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
    @@ -134,9 +132,13 @@

    E

     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
     
    -
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    +
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
    +
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest
     
    -
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    @@ -150,16 +152,14 @@

    E

     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    -
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward
    +
     
    +
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetReverse
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    -
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    -
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
    -
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.turret.Shoot
     
    execute() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
    diff --git a/docs/index-files/index-5.html b/docs/index-files/index-5.html index 7243b5b..1759d0d 100644 --- a/docs/index-files/index-5.html +++ b/docs/index-files/index-5.html @@ -2,9 +2,9 @@ - + F-Index - + @@ -74,8 +74,50 @@

    F

    +
    filterContours(List<MatOfPoint>, double, double, double, double, double, double, double[], double, double, double, double, List<MatOfPoint>) - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    Filters out contours that do not meet certain criteria.
    +
    +
    filterContours(List<MatOfPoint>, double, double, double, double, double, double, double[], double, double, double, double, List<MatOfPoint>) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    Filters out contours that do not meet certain criteria.
    +
    +
    filterContoursOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
     
    +
    filterContoursOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    This method is a generated getter for the output of a Filter_Contours.
    +
    +
    filterContoursOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
     
    +
    filterContoursOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    This method is a generated getter for the output of a Filter_Contours.
    +
    filteredContours - Variable in class org.usfirst.frc.team3494.robot.Robot
     
    +
    findContours(Mat, boolean, List<MatOfPoint>) - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    Sets the values of pixels in a binary image to their distance to the + nearest black pixel.
    +
    +
    findContours(Mat, boolean, List<MatOfPoint>) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    Sets the values of pixels in a binary image to their distance to the + nearest black pixel.
    +
    +
    findContoursOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
     
    +
    findContoursOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
    +
    This method is a generated getter for the output of a Find_Contours.
    +
    +
    findContoursOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
     
    +
    findContoursOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    This method is a generated getter for the output of a Find_Contours.
    +
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-6.html b/docs/index-files/index-6.html index baa4320..d19d9cd 100644 --- a/docs/index-files/index-6.html +++ b/docs/index-files/index-6.html @@ -2,9 +2,9 @@ - + G-Index - + @@ -78,19 +78,31 @@

    G

     
    GEAR_GRASP_CHTWO - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    +
    GEAR_GRASP_S2_BACKWARD - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    +
    GEAR_GRASP_S2_FORWARD - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    +
     
    GEAR_RAMP_CHONE - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    GEAR_RAMP_CHTWO - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    +
    GearPipeline - Class in org.usfirst.frc.team3494.robot.vision
    +
    +
    GearPipeline class.
    +
    +
    GearPipeline() - Constructor for class org.usfirst.frc.team3494.robot.vision.GearPipeline
    +
     
    gearPlaceAttempt() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
     
    +
    gearPlaceAttemptLeft() - Static method in class org.usfirst.frc.team3494.robot.AutoGenerator
    +
     
    gearTake - Static variable in class org.usfirst.frc.team3494.robot.Robot
     
    -
    GearTake - Class in org.usfirst.frc.team3494.robot.subsystems
    +
    GearTake_2 - Class in org.usfirst.frc.team3494.robot.subsystems
    Gear holder subsystem.
    -
    GearTake() - Constructor for class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    GearTake_2() - Constructor for class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
     
    getAvgDistance(UnitTypes) - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    @@ -100,7 +112,7 @@

    G

    getDistance(TurretEncoders) - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    -
    getGearState() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    getGearState() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    Gets the state of the gear holder.
    @@ -115,7 +127,9 @@

    G

    getMotorCurrent() - Method in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    -
    getRampState() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    +
    getPos() - Method in class org.usfirst.frc.team3494.robot.subsystems.MonoGearTake
    +
     
    +
    getRampState() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
    Gets the state of the intake ramp solenoid.
    @@ -125,6 +139,12 @@

    G

    getState() - Method in class org.usfirst.frc.team3494.robot.subsystems.Climber
     
    +
    GripPipeline - Class in org.usfirst.frc.team3494.robot.vision
    +
    +
    GripPipeline class.
    +
    +
    GripPipeline() - Constructor for class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
     
    A C D E F G H I K L M N O P R S T U V W X  diff --git a/docs/index-files/index-7.html b/docs/index-files/index-7.html index 6dd5e90..ab45822 100644 --- a/docs/index-files/index-7.html +++ b/docs/index-files/index-7.html @@ -2,9 +2,9 @@ - + H-Index - + @@ -80,12 +80,22 @@

    H

    HoldDriveTrain() - Constructor for class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    -
    HoldInState - Class in org.usfirst.frc.team3494.robot.commands.gears
    +
    HoldInState_Forward - Class in org.usfirst.frc.team3494.robot.commands.gears
    Holds the gear holder in the given position until canceled.
    -
    HoldInState() - Constructor for class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
    +
    HoldInState_Forward() - Constructor for class org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward
     
    +
    hslThreshold(Mat, double[], double[], double[], Mat) - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    Segment an image based on hue, saturation, and luminance ranges.
    +
    +
    hslThresholdOutput - Variable in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
     
    +
    hslThresholdOutput() - Method in class org.usfirst.frc.team3494.robot.vision.GripPipeline
    +
    +
    This method is a generated getter for the output of a HSL_Threshold.
    +
    hypot - Variable in class org.usfirst.frc.team3494.robot.commands.auto.XYDrive
     
    diff --git a/docs/index-files/index-8.html b/docs/index-files/index-8.html index 606790e..7fec1b4 100644 --- a/docs/index-files/index-8.html +++ b/docs/index-files/index-8.html @@ -2,9 +2,9 @@ - + I-Index - + @@ -90,12 +90,12 @@

    I

     
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    -
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake
    -
     
    -
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.Intake
    +
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.GearTake_2
     
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.Kompressor
     
    +
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.MonoGearTake
    +
     
    initDefaultCommand() - Method in class org.usfirst.frc.team3494.robot.subsystems.Turret
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.AngleTurn
    @@ -106,9 +106,13 @@

    I

     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
     
    -
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    +
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
    +
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest
     
    -
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    @@ -122,40 +126,22 @@

    I

     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    -
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward
    +
     
    +
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetReverse
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    -
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    -
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
    -
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.turret.Shoot
     
    initialize() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
     
    initStaging() - Method in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    -
    inMotor - Variable in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
    -
    Talon that controls the intake.
    -
    -
    intake - Static variable in class org.usfirst.frc.team3494.robot.Robot
    -
     
    -
    Intake - Class in org.usfirst.frc.team3494.robot.subsystems
    -
    -
    Intake subsystem.
    -
    -
    Intake() - Constructor for class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    INTAKE_MOTOR - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
     
    -
    INTAKE_PISTON_CHONE - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    -
     
    -
    INTAKE_PISTON_CHTWO - Static variable in class org.usfirst.frc.team3494.robot.RobotMap
    -
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.AngleTurn
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
    @@ -164,9 +150,13 @@

    I

     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
     
    -
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    +
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
    +
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest
     
    -
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    @@ -180,24 +170,20 @@

    I

     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    -
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward
    +
     
    +
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetReverse
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    -
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    -
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
    -
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.turret.Shoot
     
    interrupted() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
     
    inverter - Variable in class org.usfirst.frc.team3494.robot.subsystems.Drivetrain
     
    -
    isDeployed - Variable in class org.usfirst.frc.team3494.robot.subsystems.Intake
    -
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.AngleTurn
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive
    @@ -206,9 +192,13 @@

    I

     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDAngleDrive
     
    -
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDStraightDrive
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.PIDFullDrive
    +
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.SetGearGrasp
    +
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.SpeedTest
     
    -
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.StageTest
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.auto.tests.StageTest
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.climb.Climb
     
    @@ -222,16 +212,14 @@

    I

     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.drive.HoldDriveTrain
     
    -
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.HoldInState_Forward
    +
     
    +
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.SetReverse
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearPosition
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.gears.ToggleGearRamp
     
    -
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.intake.RunIntake
    -
     
    -
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.intake.SwitchPosition
    -
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.turret.Shoot
     
    isFinished() - Method in class org.usfirst.frc.team3494.robot.commands.turret.TurretCon
    diff --git a/docs/index-files/index-9.html b/docs/index-files/index-9.html index a15ef4c..4eddc39 100644 --- a/docs/index-files/index-9.html +++ b/docs/index-files/index-9.html @@ -2,9 +2,9 @@ - + K-Index - + diff --git a/docs/index.html b/docs/index.html index 016ba9a..9699dbd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":9,"i1":9,"i2":9,"i3":9}; +var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -156,21 +156,33 @@

    Method Summary

    static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> +activeGearRight()  + + +static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> +activeLeftGear()  + + +static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> autoOne()
    Test method.
    - + static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> crossBaseLine()
    Drives to the baseline and earns us five points (hopefully.)
    - + static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> gearPlaceAttempt()  - + +static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> +gearPlaceAttemptLeft()  + + static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> placeCenterGear()  @@ -264,12 +276,39 @@

    placeCenterGear

    -
      +
      • gearPlaceAttempt

        public static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> gearPlaceAttempt()
      + + + +
        +
      • +

        gearPlaceAttemptLeft

        +
        public static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> gearPlaceAttemptLeft()
        +
      • +
      + + + +
        +
      • +

        activeLeftGear

        +
        public static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> activeLeftGear()
        +
      • +
      + + + +
        +
      • +

        activeGearRight

        +
        public static java.util.ArrayList<edu.wpi.first.wpilibj.command.Command> activeGearRight()
        +
      • +
    diff --git a/docs/org/usfirst/frc/team3494/robot/DriveDirections.html b/docs/org/usfirst/frc/team3494/robot/DriveDirections.html index 75f9433..c95604d 100644 --- a/docs/org/usfirst/frc/team3494/robot/DriveDirections.html +++ b/docs/org/usfirst/frc/team3494/robot/DriveDirections.html @@ -2,9 +2,9 @@ - + DriveDirections - + diff --git a/docs/org/usfirst/frc/team3494/robot/OI.html b/docs/org/usfirst/frc/team3494/robot/OI.html index e4d50d3..d4f0b6e 100644 --- a/docs/org/usfirst/frc/team3494/robot/OI.html +++ b/docs/org/usfirst/frc/team3494/robot/OI.html @@ -2,9 +2,9 @@ - + OI - + @@ -126,6 +126,14 @@

    Field Summary

    Field and Description +edu.wpi.first.wpilibj.Joystick +stick_l  + + +edu.wpi.first.wpilibj.Joystick +stick_r  + + edu.wpi.first.wpilibj.XboxController xbox  @@ -250,6 +258,24 @@

    xbox_2

    public final edu.wpi.first.wpilibj.XboxController xbox_2
    + + + +
      +
    • +

      stick_l

      +
      public final edu.wpi.first.wpilibj.Joystick stick_l
      +
    • +
    + + + +
      +
    • +

      stick_r

      +
      public final edu.wpi.first.wpilibj.Joystick stick_r
      +
    • +
    diff --git a/docs/org/usfirst/frc/team3494/robot/Robot.html b/docs/org/usfirst/frc/team3494/robot/Robot.html index 0e1db2b..b2630ba 100644 --- a/docs/org/usfirst/frc/team3494/robot/Robot.html +++ b/docs/org/usfirst/frc/team3494/robot/Robot.html @@ -2,9 +2,9 @@ - + Robot - + @@ -191,7 +191,7 @@

    Field Summary

    filteredContours  -static GearTake +static GearTake_2 gearTake  @@ -207,30 +207,26 @@

    Field Summary

    imgLock  -static Intake -intake  - - static Kompressor kompressor  - + static OI oi  - + static edu.wpi.first.wpilibj.PowerDistributionPanel pdp  - + static edu.wpi.first.wpilibj.Preferences prefs  - + static Turret turret  - + (package private) edu.wpi.first.wpilibj.vision.VisionThread visionThread  @@ -391,15 +387,6 @@

    turret

    public static Turret turret
    - - - -
      -
    • -

      intake

      -
      public static Intake intake
      -
    • -
    @@ -415,7 +402,7 @@

    kompressor

    diff --git a/docs/org/usfirst/frc/team3494/robot/RobotMap.html b/docs/org/usfirst/frc/team3494/robot/RobotMap.html index 6b51788..9c0dbe9 100644 --- a/docs/org/usfirst/frc/team3494/robot/RobotMap.html +++ b/docs/org/usfirst/frc/team3494/robot/RobotMap.html @@ -2,9 +2,9 @@ - + RobotMap - + @@ -183,23 +183,23 @@

    Field Summary

    static int -
    GEAR_RAMP_CHONE  +GEAR_GRASP_S2_BACKWARD  static int -GEAR_RAMP_CHTWO  +GEAR_GRASP_S2_FORWARD  static int -INTAKE_MOTOR  +GEAR_RAMP_CHONE  static int -INTAKE_PISTON_CHONE  +GEAR_RAMP_CHTWO  static int -INTAKE_PISTON_CHTWO  +INTAKE_MOTOR  static int @@ -215,6 +215,14 @@

    Field Summary

    static int +MONO_GEAR_FORWARD  + + +static int +MONO_GEAR_REVERSE  + + +static int rightTalonOne  @@ -226,26 +234,30 @@

    Field Summary

    rightTalonTwo  +static long +TALON_RESET_DELAY  + + static int TURRET_LOWER  - + static int TURRET_RING  - + static int TURRET_UPPER  - + static int UP_MOTOR  - + static int XBOX_ONE  - + static int XBOX_TWO  @@ -596,88 +608,88 @@

    COMPRESSOR

    - + - + - + - + - + - + -
      +
      • CONVEYER_M

        public static final int CONVEYER_M
        @@ -687,6 +699,45 @@

        CONVEYER_M

      + + + +
        +
      • +

        MONO_GEAR_FORWARD

        +
        public static final int MONO_GEAR_FORWARD
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        MONO_GEAR_REVERSE

        +
        public static final int MONO_GEAR_REVERSE
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        TALON_RESET_DELAY

        +
        public static final long TALON_RESET_DELAY
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
    diff --git a/docs/org/usfirst/frc/team3494/robot/UnitTypes.html b/docs/org/usfirst/frc/team3494/robot/UnitTypes.html index 5083b2b..facd93f 100644 --- a/docs/org/usfirst/frc/team3494/robot/UnitTypes.html +++ b/docs/org/usfirst/frc/team3494/robot/UnitTypes.html @@ -2,9 +2,9 @@ - + UnitTypes - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html b/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html index 58e85de..965ff65 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/AutoGenerator.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.AutoGenerator - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html b/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html index f14e72e..8ec0add 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/DriveDirections.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.DriveDirections - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/OI.html b/docs/org/usfirst/frc/team3494/robot/class-use/OI.html index e0bdb8d..bf6b94b 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/OI.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/OI.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.OI - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html b/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html index 077dc7e..cc4ab50 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/Robot.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.Robot - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html b/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html index 4482518..076c3c6 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/RobotMap.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.RobotMap - + diff --git a/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html b/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html index 8050a00..aa6f558 100644 --- a/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html +++ b/docs/org/usfirst/frc/team3494/robot/class-use/UnitTypes.html @@ -2,9 +2,9 @@ - + Uses of Class org.usfirst.frc.team3494.robot.UnitTypes - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html b/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html index 7a6b7d3..71731ed 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/DelayCommand.html @@ -2,9 +2,9 @@ - + DelayCommand - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html index e921a33..cbd6f67 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/AngleTurn.html @@ -2,9 +2,9 @@ - + AngleTurn - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html index b00bbfd..5db21a2 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.html @@ -2,9 +2,9 @@ - + ConstructedAuto - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html index 5e1191b..9e2b26a 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/DistanceDrive.html @@ -2,9 +2,9 @@ - + DistanceDrive - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.html index 934ed66..fd9a3d0 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/NullAuto.html @@ -2,9 +2,9 @@ - + NullAuto - + diff --git a/docs/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.html b/docs/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.html index f1bf55c..c63ac72 100644 --- a/docs/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.html +++ b/docs/org/usfirst/frc/team3494/robot/commands/auto/PIDAngleDrive.html @@ -2,9 +2,9 @@ - + PIDAngleDrive - + @@ -50,7 +50,7 @@