From: Harel Dor Date: Fri, 25 Mar 2016 20:52:59 +0000 (-0700) Subject: Remove sendable choosers, fix joystick driving bug, use right twist instead of right... X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=c859a8e2f7dcd8ce870586ec5a87f459b97a362c Remove sendable choosers, fix joystick driving bug, use right twist instead of right x for twist --- diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 2b58d19d..e3b51888 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -10,7 +10,6 @@ import edu.wpi.first.wpilibj.CameraServer; import edu.wpi.first.wpilibj.IterativeRobot; import edu.wpi.first.wpilibj.command.Scheduler; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; public class Robot extends IterativeRobot { public static OI oi; @@ -30,38 +29,21 @@ public class Robot extends IterativeRobot { oi = new OI(); - initializeSendableChooser(); - addFrontChooserOptions(); - sendSendableChooserToSmartDashboard(); - camera = CameraServer.getInstance(); - camera.setQuality(50); + camera.setQuality(25); camera.startAutomaticCapture("cam0"); } - private void initializeSendableChooser() { - frontChooser = new SendableChooser(); - } - - private void addFrontChooserOptions() { - frontChooser.addDefault("Intake", false); - frontChooser.addObject("Shooter", true); - } - - private void sendSendableChooserToSmartDashboard() { - SmartDashboard.putData("PositionChooser", frontChooser); - } - @Override public void autonomousInit() { - // get options chosen from drop down menu - boolean flip = (boolean) frontChooser.getSelected(); - - if (flip) { - driveTrain.toggleFlipped(); - } - - Scheduler.getInstance().add(new TimeDrive(4, .7)); + // + // Scheduler.getInstance().add(new + // MoveIntakeArm(Constants.IntakeArm.RETRACT)); + // Scheduler.getInstance().add(new TimeDrive(1, .6)); + // Scheduler.getInstance().add(new WaitCommand(1)); + // Scheduler.getInstance().add(new + // MoveIntakeArm(Constants.IntakeArm.EXTEND)); + Scheduler.getInstance().add(new TimeDrive(8, -.8)); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java b/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java index c246ccfa..fe1a9726 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java @@ -22,7 +22,7 @@ public class JoystickDrive extends Command { @Override protected void execute() { double left = -OI.leftJoystick.getY(); - double right = -OI.rightJoystick.getX(); + double right = -OI.rightJoystick.getTwist(); Robot.driveTrain.drive(left, right); } diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index f1daa637..eb819f1c 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -198,7 +198,7 @@ public class DriveTrain extends PIDSubsystem { double k = (isFlipped() ? -1 : 1); // During teleop, leftY is throttle, rightX is twist. - robotDrive.arcadeDrive(-left * k, -right * k); + robotDrive.arcadeDrive(-left * k, -right); } public void setMotorSpeeds(double left, double right) {