From: Harel Dor Date: Thu, 10 Mar 2016 06:03:31 +0000 (-0800) Subject: More competition updates, intake speed and joystick scaling X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=116863c576fd9df4b1369bfa1c5901e939a3fe74 More competition updates, intake speed and joystick scaling --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 3c27d488..923914bc 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -41,6 +41,9 @@ public class Constants { public static final int ARCADE = 1; public static final int DRIVE_TYPE = TANK; + // Limits changes in speed during joystick driving + public static final double kADJUST = 8; + // Drivetrain Motor related ports public static final int DRIVE_FRONT_LEFT = 1; public static final int DRIVE_REAR_LEFT = 2; @@ -103,7 +106,7 @@ public class Constants { public static final int OUT = -1; // for roller - public static final double INTAKE_SPEED = 0.5; - public static final double OUTPUT_SPEED = -0.5; + public static final double INTAKE_SPEED = 0.7; + public static final double OUTPUT_SPEED = -0.7; } } diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 8616cfa7..35bf8a58 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,8 +1,6 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear; -import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm; -import org.usfirst.frc.team3501.robot.commands.shooter.ResetCatapult; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; import org.usfirst.frc.team3501.robot.subsystems.Shooter; @@ -37,8 +35,6 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { Scheduler.getInstance().add(new SetHighGear()); - Scheduler.getInstance().add(new ResetCatapult()); - Scheduler.getInstance().add(new MoveIntakeArm(Constants.IntakeArm.EXTEND)); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleFront.java b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleFront.java index ee7cfc51..4c3d34fc 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleFront.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleFront.java @@ -16,7 +16,7 @@ public class ToggleFront extends Command { // Called just before this Command runs the first time @Override protected void initialize() { - Robot.driveTrain.switchGear(); + Robot.driveTrain.toggleFlipped(); } // Called repeatedly when this Command is scheduled to run diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index eeac4900..3d406d7c 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -195,8 +195,18 @@ public class DriveTrain extends PIDSubsystem { int type = Constants.DriveTrain.DRIVE_TYPE; double k = (isFlipped() ? -1 : 1); if (type == Constants.DriveTrain.TANK) { + double leftSpeed = (-frontLeft.get() + -rearLeft.get()) / 2; + double rightSpeed = (-frontRight.get() + -rearRight.get()) / 2; + left = ((Constants.DriveTrain.kADJUST - 1) * leftSpeed + left) + / Constants.DriveTrain.kADJUST; + right = ((Constants.DriveTrain.kADJUST - 1) * rightSpeed + right) + / Constants.DriveTrain.kADJUST; robotDrive.tankDrive(-left * k, -right * k); } else if (type == Constants.DriveTrain.ARCADE) { + double speed = (-frontLeft.get() + -rearLeft.get() + -frontRight.get() + -rearRight + .get()) / 2; + left = ((Constants.DriveTrain.kADJUST - 1) * speed + left) + / Constants.DriveTrain.kADJUST; robotDrive.arcadeDrive(left * k, right); } }