From b3bdd589f32d9c152d05388ae3ad0d9e56ec833c Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Mon, 22 Feb 2016 16:29:24 -0800 Subject: [PATCH] Add testing stuff --- src/org/usfirst/frc/team3501/robot/Robot.java | 11 +++++++++-- .../team3501/robot/subsystems/DriveTrain.java | 16 ++++++++-------- .../frc/team3501/robot/subsystems/Scaler.java | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 19fa056a..1f86b9bc 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -8,6 +8,7 @@ import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; import org.usfirst.frc.team3501.robot.subsystems.Scaler; import org.usfirst.frc.team3501.robot.subsystems.Shooter; +import edu.wpi.first.wpilibj.Compressor; import edu.wpi.first.wpilibj.IterativeRobot; import edu.wpi.first.wpilibj.command.Scheduler; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; @@ -23,10 +24,12 @@ public class Robot extends IterativeRobot { public static IntakeArm intakeArm; public static DefenseArm defenseArm; + public static Compressor compressor; + // Sendable Choosers send a drop down menu to the Smart Dashboard. SendableChooser positionChooser; SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense, - positionFourDefense, positionFiveDefense; + positionFourDefense, positionFiveDefense; @Override public void robotInit() { @@ -41,6 +44,7 @@ public class Robot extends IterativeRobot { // addPositionChooserOptions(); // addDefensesToAllDefenseSendableChoosers(); // sendSendableChoosersToSmartDashboard(); + compressor = new Compressor(); } @@ -121,8 +125,11 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { - Scheduler.getInstance().add(new JoystickDrive()); + Scheduler.getInstance().add(new JoystickDrive()); + compressor.start(); + driveTrain.leftGearPiston.set(Constants.DriveTrain.HIGH_GEAR); + driveTrain.rightGearPiston.set(Constants.DriveTrain.HIGH_GEAR); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index a7fa8eea..cde94b8f 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -28,7 +28,7 @@ public class DriveTrain extends PIDSubsystem { private RobotDrive robotDrive; private GyroLib gyro; - private DoubleSolenoid leftGearPiston, rightGearPiston; + public DoubleSolenoid leftGearPiston, rightGearPiston; // Drivetrain specific constants that relate to the inches per pulse value for // the encoders @@ -197,10 +197,10 @@ public class DriveTrain extends PIDSubsystem { /* * Method is a required method that the PID Subsystem uses to return the * calculated PID value to the driver - * + * * @param Gives the user the output from the PID algorithm that is calculated * internally - * + * * Body: Uses the output, does some filtering and drives the robot */ @Override @@ -229,7 +229,7 @@ public class DriveTrain extends PIDSubsystem { /* * Checks the drive mode - * + * * @return the current state of the robot in each state Average distance from * both sides of tank drive for Encoder Mode Angle from the gyro in GYRO_MODE */ @@ -265,9 +265,9 @@ public class DriveTrain extends PIDSubsystem { /* * constrains the distance to within -100 and 100 since we aren't going to * drive more than 100 inches - * + * * Configure Encoder PID - * + * * Sets the setpoint to the PID subsystem */ public void driveDistance(double dist, double maxTimeOut) { @@ -307,10 +307,10 @@ public class DriveTrain extends PIDSubsystem { /* * Turning method that should be used repeatedly in a command - * + * * First constrains the angle to within -360 and 360 since that is as much as * we need to turn - * + * * Configures Gyro PID and sets the setpoint as an angle */ public void turnAngle(double angle) { diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java index e56e4a81..283b1e6c 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java @@ -12,7 +12,7 @@ public class Scaler extends Subsystem { private CANTalon winch; public Scaler() { - scaler = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, + scaler = new DoubleSolenoid(9, Constants.Scaler.FORWARD_CHANNEL, Constants.Scaler.REVERSE_CHANNEL); winch = new CANTalon(Constants.Scaler.WINCH_MOTOR); } -- 2.30.2